Ejemplo n.º 1
0
        public void TestCase1()
        {
            string searchTextData         = xHelper.GetFormData("TestSearchText");
            string searchResultLabelXPath = xHelper.GetXPathData("TopicSearchLabel");

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

                automationHelper.DoSearch(driver, searchTextData);

                if (automationHelper.WaitTillDisplayed(driver, searchResultLabelXPath))
                {
                    IWebElement searchLabel = driver.FindElement(By.XPath(searchResultLabelXPath));
                    Assert.IsTrue(searchLabel.Text == searchTextData);
                }
                else
                {
                    Console.WriteLine("Topic search label did not appear.");
                    Assert.Fail("Searched text does not appear as expected.");
                }

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