Example #1
0
        public void SelectFirstSuggestion()
        {
            try
            {
                IWebDriver driver = new ChromeDriver();
                driver.Navigate().GoToUrl("http://www.google.com");
                driver.Manage().Window.Maximize();
                driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(5);

                HomePage homePage = new HomePage(driver);
                homePage.SendQuery("The name of the wind by P");
                homePage.SelectFirstSuggestion();

                ResultsPage resultsPage = new ResultsPage(driver);
                resultsPage.SelectFirstResult();

                Thread.Sleep(1000);
                driver.Close();
            }
            catch (Exception ex)
            {
                Assert.Fail(ex.Message);
            }
        }