/// <summary> /// Search cars of interested brand. /// </summary> /// <param name="driver"></param> /// <param name="homePageLocators"></param> /// <param name="wait"></param> /// <param name="interestedBrand"></param> /// <returns>SearchResultPage.</returns> public SearchResultPage FindInterestBrand(IWebDriver driver, HomePageLocators homePageLocators, WebDriverWait wait, string selectedBrand) { wait.Until(ExpectedConditions.ElementToBeClickable(homePageLocators.brandSearchFilterParameter)).Click(); wait.Until(ExpectedConditions.ElementIsVisible(By.XPath(String.Format("//select[@name = 'brand_id[]']/option[text() = '{0}']", selectedBrand)))).Click(); wait.Until(ExpectedConditions.ElementToBeClickable(homePageLocators.searchButton)).Click(); return(new SearchResultPage(driver)); }
static void Main(string[] args) { try { string selectedBrand = args[0]; IWebDriver driver = new FirefoxDriver(); WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(11)); Console.WriteLine("Selected car brand: " + selectedBrand); HomePageLocators homePageLocators = new HomePageLocators(); HomePage homePage = new HomePage(driver); homePage.GotoHomePage(driver); SearchResultPage searchResultPage = homePage.FindInterestBrand(driver, homePageLocators, wait, selectedBrand); SearchResultPageLocators searchResultPageLocators = new SearchResultPageLocators(); searchResultPage.OutputSortedCars(searchResultPage.SortedCarsList(searchResultPage.GetCarsAllPages(driver, searchResultPageLocators, wait))); driver.Quit(); } catch (Exception ex) { Console.WriteLine(ex.Message); } }
public void RegistrationUserSuccesful_CorrectRegistration_ReturnTrue() { IWebDriver driver = new FirefoxDriver(); RegistrationPage registrationPage = new RegistrationPage(driver); RegistrationPageLocators registrationPageLocators = new RegistrationPageLocators(); HomePageLocators homePageLocators = new HomePageLocators(); User user = new User(); WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(11)); registrationPage.GoToRegistrationPage(driver); HomePage resultPage = registrationPage.RegistrationUserSuccesful(user, wait, registrationPageLocators); driver.Quit(); }
static void Main(string[] args) { IWebDriver driver = new FirefoxDriver(); HomePage homePage = new HomePage(driver); WebDriverWait wait = new WebDriverWait(driver, new TimeSpan(0, 0, 11)); HomePageLocators homePageLocators = new HomePageLocators(); homePage.GoToHomePage(); homePage.InputFilterParametersForBMW_M5(driver, wait, homePageLocators); SearchResultPage searchResultPage = homePage.GoToSearchResultPage(driver, wait, homePageLocators); SearchResultPageLocators searchResultPageLocators = new SearchResultPageLocators(); searchResultPage.SortCarsByPrice(driver, wait, searchResultPageLocators); Console.WriteLine("Price of cheapest BMW M5 : " + searchResultPage.GetPriceCheapestBMW_M5(driver, wait, searchResultPageLocators)); driver.Quit(); }
/// <summary> /// Go to search result page. /// </summary> /// <param name="driver"></param> /// <param name="wait"></param> /// <returns>Search result page.</returns> public SearchResultPage GoToSearchResultPage(IWebDriver driver, WebDriverWait wait, HomePageLocators homePageLocators) { wait.Until(ExpectedConditions.ElementToBeClickable(homePageLocators.submitSearchBMW_M5)).Click(); return(new SearchResultPage(driver)); }
/// <summary> /// Input filter parameters. /// </summary> /// <param name="driver"></param> /// <param name="wait"></param> public void InputFilterParametersForBMW_M5(IWebDriver driver, WebDriverWait wait, HomePageLocators homePageLocators) { wait.Until(ExpectedConditions.ElementToBeClickable(homePageLocators.brandSelecter)).Click();; wait.Until(ExpectedConditions.ElementToBeClickable(homePageLocators.brandBMW)).Click(); wait.Until(ExpectedConditions.ElementToBeClickable(homePageLocators.modelSelecter)).Click(); wait.Until(ExpectedConditions.ElementToBeClickable(homePageLocators.modelBMW_M5)).Click(); }
public Home(IWebDriver _driver) : base(_driver) { _homepageLocator = new HomePageLocators(); _commonFlow = new CommonFlow(_driver); }