Пример #1
0
        public static IWebDriverExt SwitchToDefaultContent(this IWebDriverExt driver)
        {
            driver.WaitReadyState();

            driver.SwitchTo().DefaultContent();

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

            driver.WaitReadyState();

            return(driver);
        }
        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);
        }