public static void BeforeTestRun()
 {
     Driver          = driver;
     DriverActions   = driverActions;
     SeleniumActions = seleniumActions;
     SeleniumWaits   = seleniumWaits;
     SeleniumVerify  = seleniumVerify;
     Report          = report;
     Report.InitializeReport();
 }
Esempio n. 2
0
 /// <summary>
 /// Verifies message on browser alert.
 /// </summary>
 /// <param name="msg"> message that has to be verified.</param>
 public void VerifyBrowserAlertMsg(string msg, WaitType waitType)
 {
     try
     {
         SeleniumWaits   seleniumWaits   = new SeleniumWaits();
         SeleniumActions seleniumActions = new SeleniumActions();
         seleniumWaits.WaitForAlertToBePresent(waitType);
         string alertMsg = seleniumActions.GetAlertText();
         Assert.AreEqual(alertMsg, msg);
         seleniumActions.AcceptAlert();
     }
     catch (Exception e)
     {
         CustomExceptionHandler.CustomException(e, "Could not find browser level alert message because of an Exception: ");
     }
 }
 public void VerifyNumberOfSearchResultsLink(int expectedNumberOfLinks)
 {
     SearchResultLinks = SeleniumActions.FindElements(SearchResultLink);
     Assert.IsTrue(expectedNumberOfLinks < SearchResultLinks.Count, "Actual number of links: " + SearchResultLinks.Count + " is less than the expected number of links: " + expectedNumberOfLinks);
 }
 public void ClickOnGoogleSearchButton()
 {
     SeleniumActions.Click(GoogleSearchButton);
     SeleniumWaits.WaitForPageLoad();
 }
 public void EnterKeywordInGoogleSearchBox(string keyword)
 {
     SeleniumActions.Clear(GoogleSearchBox);
     SeleniumActions.SendKeys(GoogleSearchBox, keyword);
     SeleniumActions.PressKey(GoogleSearchBox, Keys.Tab);
 }