Esempio n. 1
0
        public void ByChildrenOf_Simple_Crossbrowser(string driver)
        {
            SetUp(driver);

            var parentElement = Driver.FindElement(By.TagName("ol"));
            var secondChild   = parentElement.FindElement(By.XPath("./li[2]"));

            var resultChild = Driver.FindElement(ByExtension.ChildrenOf(By.TagName("ol"), 1));

            Assert.AreEqual(secondChild, resultChild);
        }
        public void ByChildrenOf_Simple_Crossbrowser(string driver)
        {
            SetUp(driver);

            var olList = Driver.FindElements(By.CssSelector("ol li"));

            Assert.AreEqual(4, olList.Count);

            var resultList = Driver.FindElements(ByExtension.ChildrenOf(By.TagName("ol")));

            Assert.AreEqual(olList, resultList);
        }
Esempio n. 3
0
        public void ChildrenOf_Out_Of_Range_Throws_No_Such_Element_Exception()
        {
            SetUp();

            var e = new Exception();

            try
            {
                var resultChild = Driver.FindElement(ByExtension.ChildrenOf(By.TagName("ol"), 5));
            }
            catch (Exception ex)
            {
                e = ex;
            }

            Assert.IsTrue(e is NoSuchElementException);
        }