public void SelectItem() { var searchedItemText = "It: film tie-in edition of Stephen King’s IT"; IWebDriver drv = new ChromeDriver(); drv.Manage().Window.Maximize(); var amazonHomePage = new AmazonHomePage(drv); amazonHomePage.NavigateTo(); amazonHomePage.IsAt(); amazonHomePage.Header.GetHeaderParts.SearchBar.SearchDropDown.SelectItemByName("Books"); amazonHomePage.Header.GetHeaderParts.SearchBar.InputField.Text = searchedItemText; amazonHomePage.Header.GetHeaderParts.SearchBar.SubmitSearchButton.Click(); var amazonBooksSearchResultsPage = new AmazonBooksSearchResultsPage(drv); var titleText = amazonBooksSearchResultsPage.SearchResults.GetDetailRow(0).Title.Text; var fisrSelectedTypeText = amazonBooksSearchResultsPage.SearchResults.GetDetailRow(2).FirstSelectedType.Text; var fistSelectedTypePrice = amazonBooksSearchResultsPage.SearchResults.GetDetailRow(2).FirstSelectedTypePrice.Text; }
internal Context() { drv = new ChromeDriver(); amazonHomePage = new AmazonHomePage(drv); amazonBooksSearchResultsPage = new AmazonBooksSearchResultsPage(drv); }