예제 #1
0
        public void LazyElementFindElementsGetVisible()
        {
            LazyElement lazyRoot       = new LazyElement(this.TestObject, By.CssSelector("#ItemsToAutomate"));
            IWebElement secondTable    = lazyRoot.FindLazyElements(By.CssSelector("TABLE"))[1];
            IWebElement getSecondTable = ((LazyElement)secondTable).GetTheVisibleElement();

            Assert.AreEqual(secondTable.Text, getSecondTable.Text);
        }
예제 #2
0
        public void LazyElementFindElementsStackedWithStale()
        {
            LazyElement lazyRoot        = new LazyElement(this.TestObject, By.CssSelector("#ItemsToAutomate"));
            IWebElement secondTable     = lazyRoot.FindLazyElements(By.CssSelector("TABLE"))[1];
            IWebElement lastTableHeader = ((LazyElement)secondTable).FindLazyElements(By.CssSelector("THEAD TH"))[4];

            this.WebDriver.Navigate().GoToUrl(SeleniumConfig.GetWebSiteBase());
            this.WebDriver.Navigate().GoToUrl(SeleniumConfig.GetWebSiteBase() + "Automation");

            Assert.AreEqual("Color", lastTableHeader.Text);
        }