Exemple #1
0
        public void TestCase2()
        {
            string facebookSectionXPath = xHelper.GetXPathData("Facebook");

            using (IWebDriver driver = new InternetExplorerDriver())
            {
                // Navigate to the site and login
                automationHelper.NavigateUrlAndLogin(driver);

                // Navigate to an article page
                automationHelper.CheckFacebookCommentInArticle(driver);

                // Validate the expected scenario
                if (automationHelper.WaitTillDisplayed(driver, facebookSectionXPath))
                {
                    IWebElement facebookSection = driver.FindElement(By.XPath(facebookSectionXPath));
                    Assert.IsTrue(automationHelper.ExistsElement(driver, facebookSectionXPath));
                    Console.WriteLine("Verified facebook section present to provide comments.");
                }
                else
                {
                    Console.WriteLine("Facebook section did not appear.");
                    Assert.Fail("Facebook section not found in article as expected.");
                }

                // Logout
                automationHelper.DoLogout(driver);
                driver.Quit();
            }
        }