public static IWebDriverExt AcceptAlert(this IWebDriverExt driver)
 {
     try
     {
         driver.SwitchTo().Alert().Accept();
         driver.SwitchTo().ActiveElement();
     }
     catch (NoAlertPresentException)
     {
     }
     return(driver);
 }
示例#2
0
        public static IWebDriverExt SwitchToDefaultContent(this IWebDriverExt driver)
        {
            driver.WaitReadyState();

            driver.SwitchTo().DefaultContent();

            driver.CurrentFrame = By.Id(Locators.MainHeadPage.FrameLocatorID);

            driver.WaitReadyState();

            return(driver);
        }
示例#3
0
 public static bool isAlertPresent(this IWebDriverExt driver)
 {
     try
     {
         driver.SwitchTo().Alert();
         return(true);
     }
     catch (NoAlertPresentException)
     {
         return(false);
     }
 }
        public static IWebDriverExt SwitchToFrame(this IWebDriverExt driver, By by)
        {
            driver.WaitReadyState();

            if (driver.TryFindElement(by))
            {
                IWebElement frame = driver.FindElement(by);
                driver.SwitchTo().Frame(frame);
                driver.CurrentFrame = by;
                driver.WaitReadyState();
            }

            return(driver);
        }