예제 #1
0
        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);
            }
        }
예제 #2
0
 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);
     }
 }
예제 #3
0
 public static void SwitchToActiveElement(this NgWebDriver driver)
 {
     driver.SwitchTo().ActiveElement();
 }
예제 #4
0
 public static IWebDriver SwitchToLastWindowHandle(this NgWebDriver driver)
 {
     return(driver.SwitchTo().Window(driver.WindowHandles.Last()));
 }
예제 #5
0
 public void AcceptAlert()
 {
     Retry(() => NgDriver.SwitchTo().Alert().Accept(), 3);
 }
예제 #6
0
 public IWebElement DoubleClickItem(IWebElement item)
 {
     new Actions(_driver).DoubleClick(item).Perform();
     return(_driver.SwitchTo().ActiveElement());
 }