public void Search(string keyword, GoogleHomePageObject pageObject)
 {
     try
     {
         var element = pageObject.searchBar;
         element.SendKeys(keyword);
         element.Submit();
     }
     catch (Exception e)
     {
         System.Diagnostics.Debug.WriteLine($"Exception occured - {e}");
     }
 }
Example #2
0
        public void start_Browser()
        {
            try
            {
                browser.Init_Browser();
                driver           = browser.getDriver;
                googlePageObject = new GoogleHomePageObject(driver);
                string          hostname = Dns.GetHostName();
                OperatingSystem os       = Environment.OSVersion;

                extent.AddSystemInfo("Operating System", os.ToString());
                extent.AddSystemInfo("HostName", hostname);
                extent.AddSystemInfo("Browser", "Google Chrome");

                extentReport.AddSystemInfo("Operating System", os.ToString());
                extentReport.AddSystemInfo("HostName", hostname);
                extentReport.AddSystemInfo("Browser", "Google Chrome");
            }
            catch (Exception e)
            {
                System.Diagnostics.Debug.WriteLine($"Exception occured - {e}");
            }
        }