public void NewsPage() { driver.Navigate().GoToUrl("https://www.bbc.com/news/uk-47933096"); NewsPage newsPage = new NewsPage(driver); //HaveYourSayPage haveYourSayPage = (HaveYourSayPage)newsPage.GoToNewsSection("Have your say"); newsPage.GoToHaveYourSayPage(); }
public DoYouHaveAStoryPage GoToHaveYorSayPage() { HomePage homePage = new HomePage(_driver); homePage.GoToPage(); NewsPage newsPage = homePage.GoToNewsPage(); HaveYourSayPage haveYourSayPage = newsPage.GoToHaveYourSayPage(); DoYouHaveAStoryPage doYouHaveAStoryPage = haveYourSayPage.GoToDoYouHaveAStoryPage(); return(doYouHaveAStoryPage); }
public void Test1() { IWebDriver driver = new ChromeDriver(); driver.Manage().Window.Maximize(); driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(5); HomePage homePage = new HomePage(driver); homePage.GoToPage(); NewsPage newsPage = homePage.GoToNewsPage(); streamWriter.WriteLine("Task1"); streamWriter.WriteLine(newsPage.GetHeadLineArticleText()); driver.Quit(); }
public void Test3() { IWebDriver driver = new ChromeDriver(); driver.Manage().Window.Maximize(); driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(5); HomePage homePage = new HomePage(driver); homePage.GoToPage(); NewsPage newsPage = homePage.GoToNewsPage(); string categories = newsPage.GetCategoryOfTheMainArticle(); newsPage.EnterTextToSearchBarField(categories); SearchResultsPage searchResultsPage = newsPage.ClickSearchButton(driver); Console.WriteLine("Task2"); Console.WriteLine(searchResultsPage.GetFirstArticleText()); driver.Quit(); }
public void Test2() { IWebDriver driver = new ChromeDriver(); driver.Manage().Window.Maximize(); driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(5); HomePage homePage = new HomePage(driver); homePage.GoToPage(); NewsPage newsPage = homePage.GoToNewsPage(); List <string> articles = newsPage.GetArticles(); Console.WriteLine("Task2"); for (int i = 0; i < articles.Count; i++) { Console.WriteLine(articles[i]); } driver.Quit(); }