public void GetCitiesCodeList() { Driver.Navigate().GoToUrl(mainPageUrl); WebElementHelper.WaitAndClick(Driver, By.XPath(citiesTableXPath)); var tmpList = Driver.FindElements(By.XPath(cityXPath)); List <string> cityCodeList = new List <string>(); List <string> draftList = new List <string>(); foreach (var k in tmpList) { string[] cityArr = k.Text.Split('\n'); draftList.AddRange(cityArr); } foreach (string a in draftList) { Match m = Regex.Match(a, pattern); if (m.Success) { cityCodeList.Add(m.Value); } } this.cityCodeList = cityCodeList; }
public WaitingPage BookThisFlight(BasePage bp) { Thread.Sleep(2000); WebElementHelper.WaitAndClick(Driver, By.XPath(flexWindowXPath)); WebElementHelper.WaitAndSendKeys(Driver, By.XPath(cvvXPath), cvv); WebElementHelper.WaitAndClick(Driver, By.XPath(bookThisFlightButtonXPath)); return(new WaitingPage(bp)); }
public MainPage SignIn(BasePage bp, string username, string password) { WebElementHelper.WaitAndClick(Driver, By.XPath(signInButtonXPath)); WebElementHelper.WaitAndSendKeys(Driver, By.XPath(userNameXpath), username); WebElementHelper.WaitAndSendKeys(Driver, By.XPath(userPassLocator), password); WebElementHelper.WaitAndClick(Driver, By.XPath(loginInButtonXpath)); return(new MainPage(bp)); }
public MainPage LogiIn(IWebDriver driver) { driver.Navigate().GoToUrl(baseUrl); WebElementHelper.WaitAndClick(driver, By.XPath(singInLinkXPath)); WebElementHelper.WaitAndSendKeys(driver, By.XPath(loginInputXPath), login); WebElementHelper.WaitAndSendKeys(driver, By.XPath(passInputXPath), pass); WebElementHelper.WaitAndClick(driver, By.XPath(singInButtonXPath)); return(new MainPage(driver)); }
public BookingFirstStepPage SelectFlight(BasePage bp) { bp.Refresh(); WebElementHelper.WaitAndClick(Driver, By.XPath(depAirportXPath)); WebElementHelper.WaitAndClick(Driver, By.XPath(depXPath)); WebElementHelper.WaitAndClick(Driver, By.XPath(desAirportXPath)); WebElementHelper.WaitAndClick(Driver, By.XPath(desXPath)); WebElementHelper.WaitAndClick(Driver, By.XPath(findFlightsXPath)); return(new BookingFirstStepPage(bp)); }
public WaitingPage BookThisFlight(BasePage bp) { //there is popup window on page, i can not disable it or change driver focus to web page from popup window Thread.Sleep(2000); WebElementHelper.WaitAndClick(Driver, By.XPath(flexWindowXPath)); Thread.Sleep(2000); WebElementHelper.WaitAndSendKeys(Driver, By.XPath(cvvXPath), cvv); Thread.Sleep(2000); WebElementHelper.WaitAndClick(Driver, By.XPath(bookThisFlightButtonXPath)); return(new WaitingPage(bp)); }
public BookingFirstStepPage SelectFlight(BasePage bp) { bp.Refresh(); WebElementHelper.WaitAndClick(Driver, By.XPath(oneWayRadioXPath)); Thread.Sleep(2000); WebElementHelper.WaitAndClick(Driver, By.XPath(depAirportXPath)); Thread.Sleep(2000); WebElementHelper.WaitAndClick(Driver, By.XPath(depXPath)); if (WebElementHelper.IsElementPresent(Driver, By.XPath(desXPath))) { Thread.Sleep(2000); WebElementHelper.WaitAndClick(Driver, By.XPath(desXPath)); } else { Thread.Sleep(2000); WebElementHelper.WaitAndClick(Driver, By.XPath(desAirportXPath)); Thread.Sleep(2000); WebElementHelper.WaitAndClick(Driver, By.XPath(desXPath)); } if (WebElementHelper.IsElementPresent(Driver, By.XPath(depDateCalendarXPath))) { Thread.Sleep(2000); WebElementHelper.WaitAndClick(Driver, By.XPath(depDateCalendarXPath)); } else { Thread.Sleep(2000); WebElementHelper.WaitAndClick(Driver, By.XPath(depCalendarXpath)); Thread.Sleep(2000); WebElementHelper.WaitAndClick(Driver, By.XPath(depDateCalendarXPath)); } Thread.Sleep(2000); WebElementHelper.WaitAndClick(Driver, By.XPath(findFlightsXPath)); return(new BookingFirstStepPage(bp)); }