public void Test1() { By by = By.CssSelector("a[ng-bind-html='caseName']"); var casesCount = driver.FindElements(by).Count; for (int i = 0; i < casesCount; i++) { var caseElement = driver.FindElements(by)[i]; var caseName = caseElement.Text; caseElement.Click(); waitForPage(); takeScreenShot(caseName); log.Info("****Case Name : " + caseName); if (driver.FindElements(By.Id("iframeContent")).Count > 0) { driver.SwitchTo().Frame("iframeContent"); var links = _driver.FindElements(By.CssSelector("#page a")); foreach (var link in links) { log.Info("Link Text[" + link.Text + "] HREF[" + link.GetAttribute("href") + "]"); } driver.SwitchTo().DefaultContent(); } driver.Navigate().GoToUrl(urlBase); } }
public static void BrowserAccept(this NgWebDriver driver, bool isWrapped = false) { if (isWrapped) { driver.WrappedDriver.SwitchTo().ActiveElement().SendKeys(Keys.Return); } else { driver.SwitchTo().ActiveElement().SendKeys(Keys.Return); } }
public static void SwitchToActiveElement(this NgWebDriver driver) { driver.SwitchTo().ActiveElement(); }
public static IWebDriver SwitchToLastWindowHandle(this NgWebDriver driver) { return(driver.SwitchTo().Window(driver.WindowHandles.Last())); }
public void AcceptAlert() { Retry(() => NgDriver.SwitchTo().Alert().Accept(), 3); }
public IWebElement DoubleClickItem(IWebElement item) { new Actions(_driver).DoubleClick(item).Perform(); return(_driver.SwitchTo().ActiveElement()); }