List of usage examples for org.openqa.selenium By className
public static By className(String className)
From source file:com.hotwire.selenium.desktop.row.HomePage.java
License:Open Source License
public OldFareFinder getOldFareFinder() { return new OldFareFinder(getWebDriver(), By.className(HOME_FARE_FINDER)); }
From source file:com.hotwire.selenium.desktop.row.search.CarLandingPage.java
License:Open Source License
public CarSearchFragment getCarSearchFragment() { return new CarSearchFragment(getWebDriver(), By.className("carFareFinderComp")); }
From source file:com.hotwire.selenium.desktop.row.search.HomePageFareFinder.java
License:Open Source License
@SuppressWarnings("unused") private void findFare(String destinationLocation, Date startDate, Date endDate, Integer numberOfHotelRooms, Integer numberOfAdults, Integer numberOfChildren) { this.destination.click(); this.destination.clear(); this.destination.sendKeys(destinationLocation + Keys.TAB); new WebDriverWait(getWebDriver(), DEFAULT_WAIT).until(PageObjectUtils.webElementVisibleTestFunction( fareFinderForm.findElement(By.className(FARE_FINDER_AUTOCOMPLETE_CONTENT)), false)); DatePicker startDatePicker = new DatePicker(getWebDriver(), checkInDateField); startDatePicker.selectDate(startDate); DatePicker endDatePicker = new DatePicker(getWebDriver(), checkOutDateField); endDatePicker.selectDate(endDate);//w ww .j a v a 2s . c om Select roomsCountSelect = new Select(rooms); roomsCountSelect .selectByVisibleText((numberOfHotelRooms == null) ? "1" : Integer.toString(numberOfHotelRooms)); Select adultsCountSelect = new Select(roomsAdults); adultsCountSelect.selectByVisibleText((numberOfAdults == null) ? "2" : Integer.toString(numberOfAdults)); Select childCountSelect = new Select(roomsChild); childCountSelect.selectByVisibleText((numberOfChildren == null) ? "0" : Integer.toString(numberOfChildren)); // todo: changing this from click to submit till we figure out issue with calendar popup findButton.submit(); }
From source file:com.hotwire.selenium.desktop.row.search.SemPageFareFinder.java
License:Open Source License
public SemPageFareFinder(WebDriver webdriver) { super(webdriver, By.className("pane-hotwire-sem-page-hotel-farefinder")); dateFormat = DatePicker.getDateFormat(DatePicker.DateFormats.DESKTOP_US_YYYY); }
From source file:com.hotwire.selenium.desktop.us.billing.car.impl.accordion.AcDetailsFragment.java
License:Open Source License
@Override public boolean airportResultVendorGridIsDisplayed() { return getWebDriver().findElement(By.className(CLASS_VENDOR_GRID_AIRPORT)).isDisplayed(); }
From source file:com.hotwire.selenium.desktop.us.billing.car.impl.accordion.AcPurchaseReviewFragment.java
License:Open Source License
public WebElement getPayPalBtn() { return getWebDriver().findElement(By.className("btnP")); }
From source file:com.hotwire.selenium.desktop.us.billing.car.impl.ccf.CcfPurchaseReviewFragment.java
License:Open Source License
@Override public WebElement getAgreementCheckbox() { // It is need for scrolling page getWebDriver().findElement(By.cssSelector(CSS_AGREE_AND_BOOK_IDENTIFIER)).click(); return getWebDriver().findElement(By.className(agreementCbx)); }
From source file:com.hotwire.selenium.desktop.us.billing.car.impl.fragments.CarBillingHelpCenterFragment.java
License:Open Source License
public CarBillingHelpCenterFragment(WebDriver webdriver) { super(webdriver, By.className("contactModuleHeader")); }
From source file:com.hotwire.selenium.desktop.us.billing.onepage.HotelTravelerInfoFragment.java
License:Open Source License
public HotelTravelerInfoFragment(WebDriver webDriver) { super(webDriver, By.className("travelerInfoModule")); }
From source file:com.hotwire.selenium.desktop.us.billing.onepage.HotelTripInsuranceFragment.java
License:Open Source License
@Override public AdditionalFeatures withInsurance(boolean wantTripInsurance) { // Wait for the updating layer to disappear new WebDriverWait(getWebDriver(), 15) .until(ExpectedConditions.invisibilityOfElementLocated(By.className("loadingImage"))); // Get current state of payment method fragment selection. String selectedIDValue = new HotelBillingOnePage(getWebDriver()).getSelectedPaymentMethodIDValue(); logger.info("Current selected payment method ID: " + selectedIDValue); try {/*from w ww . j a v a 2 s . c om*/ if (wantTripInsurance) { logger.info("Select insurance: YES"); yesRadioButton.click(); } else { logger.info("Select insurance: NO"); noRadioButton.click(); } // Wait until Ajax is silent new Wait<Boolean>(new IsAjaxDone()).maxWait(30).apply(getWebDriver()); // Check if selected payment has changed. String current = new HotelBillingOnePage(getWebDriver()).getSelectedPaymentMethodIDValue(); logger.info( "Before selecting insurance: " + selectedIDValue + " - After selecting insurance: " + current); if (!current.equals(selectedIDValue)) { logger.info("Reselecting payment type due to insurance selection."); getWebDriver().findElement(By.id(selectedIDValue)).click(); } new HotelBillingOnePage(getWebDriver()); } catch (NoSuchElementException e) { logger.warn("Travel Insurance panel didn't load"); } return this; }