Exemplo n.º 1
0
        /// <summary>
        /// Verify the table of content presents or not article page
        /// </summary>
        public static void CheckTableOfContents()
        {
            IWebElement divTableOfContent = driver.FindElement(By.Id(idTableOfContent));
            string      heading           = divTableOfContent.FindElement(By.TagName(tagNameTableHeading)).Text;

            CustomValidator.IsNotNullOrEmpty(heading, "There is no Heading");
            IWebElement ul = driver.FindElement(By.XPath(xpathListTableOfContent));
            var         lstSearchResults = ul.FindElements(By.TagName("li"));

            foreach (IWebElement lstItem in lstSearchResults)
            {
                CustomValidator.IsNotNullOrEmpty(lstItem.Text, "List Item is missing");
            }
        }