Example usage for org.openqa.selenium By name

List of usage examples for org.openqa.selenium By name

Introduction

In this page you can find the example usage for org.openqa.selenium By name.

Prototype

public static By name(String name) 

Source Link

Usage

From source file:com.hotwire.selenium.desktop.us.confirm.AirConfirmationPage.java

License:Open Source License

private boolean verifyHotelParameters(String destinationLocation, String startDate, String endDate) {
    boolean hotelModule = true;
    AirConfirmationPage airConfirmationPage = new AirConfirmationPage(getWebDriver());
    try {//w  w  w .  j  a  va2s . c om
        airConfirmationPage.hotelCrossSellModule.click();
        WebElement hotelCrossSellPanel = getWebDriver().findElement(By.id("newHotelPopup-panel"));
        String hotelDestination = hotelCrossSellPanel.findElement(By.name("destCity")).getAttribute("value");
        String hotelStartDate = hotelCrossSellPanel.findElement(By.name("startDate")).getAttribute("value");
        String hotelEndDate = hotelCrossSellPanel.findElement(By.name("endDate")).getAttribute("value");
        if (!hotelDestination.contains(destinationLocation) && !hotelStartDate.contains(startDate)
                && !hotelEndDate.contains(endDate)) {
            hotelModule = false;
        }
    } catch (NoSuchElementException e) {
        hotelModule = false;
        LOGGER.info("HotelCrossPanel wasn't loaded or some of the elements are missing");
    }
    return hotelModule;
}

From source file:com.hotwire.selenium.desktop.us.confirm.AirConfirmationPage.java

License:Open Source License

private boolean verifyCarParameters(String destinationLocation, String startDate, String endDate) {
    boolean carModule = true;
    AirConfirmationPage airConfirmationPage = new AirConfirmationPage(getWebDriver());
    try {//from   ww  w . ja  v a  2  s . c o m
        airConfirmationPage.carCrossSellModule.click();
        WebElement carCrossSellPanel = getWebDriver().findElement(By.id("newCarPopup-panel"));
        String carDestination = carCrossSellPanel.findElement(By.name("startLocation")).getAttribute("value");
        String carStartDate = carCrossSellPanel.findElement(By.name("startDate")).getAttribute("value");
        String carEndDate = carCrossSellPanel.findElement(By.name("endDate")).getAttribute("value");
        if (!carDestination.contains(destinationLocation) && !carStartDate.contains(startDate)
                && !carEndDate.contains(endDate)) {
            carModule = false;
        }
    } catch (NoSuchElementException e) {
        carModule = false;
        LOGGER.info("CarCrossSellPanel wasn't loaded or some of the elements are missing");
    }
    return carModule;
}

From source file:com.hotwire.selenium.desktop.us.details.AirDetailsPage.java

License:Open Source License

public void addRentalCar() {
    if (isRentalCarOptionLinkAvailable()) {
        rentalCarOption.click();//  w w  w  .j av  a2 s.  c o m
        new WebDriverWait(getWebDriver(), getTimeout())
                .until(ExpectedConditions.elementToBeClickable(By.name("selectedCarAddOnSolutionId"))).click();
    } else {
        throw new RuntimeException("Can't rent a car as add-on for flight.. The link didn't appear");
    }
}

From source file:com.hotwire.selenium.desktop.us.results.air.ExpediaAirMultiResultsPage.java

License:Open Source License

private void waitForLoadedResults() {

    WebDriverWait wait = new WebDriverWait(getWebDriver(), 60);
    wait.until(ExpectedConditions.visibilityOfElementLocated(By.name("flightLegSummary")));
}

From source file:com.hotwire.selenium.desktop.us.search.CarSearchFragment.java

License:Open Source License

public CarSearchFragment endTime(String endTime) {
    if (endTime != null) {
        new DropDownSelector(getWebDriver(), By.name("endTime")).selectByVisibleText(endTime);
    }/*from ww  w  . j ava  2  s  .c o m*/
    return new CarSearchFragment(getWebDriver());
}

From source file:com.hotwire.selenium.desktop.us.search.CarSearchFragment.java

License:Open Source License

public CarSearchFragment startTime(String startTime) {
    if (startTime != null) {
        new DropDownSelector(getWebDriver(), By.name("startTime")).selectByVisibleText(startTime);
    }/*w w  w.  ja v a 2 s . c  o  m*/
    return new CarSearchFragment(getWebDriver());
}

From source file:com.hotwire.selenium.iphone.AppsAbstractPage.java

License:Apache License

public boolean isTextOnPage(String text) {
    try {/* w ww  .ja v  a  2 s.  c om*/
        waitFor(presenceOfElementLocated(By.name(text)), 2, 500);
        return true;
    } catch (WebDriverException e) {
        return false;
    }

}

From source file:com.hotwire.selenium.tools.c3.blackList.C3BlackListPage.java

License:Open Source License

public void clickAddToBlackList() {
    findOne(By.name("add")).click();
}

From source file:com.hotwire.selenium.tools.c3.blackList.C3BlackListPage.java

License:Open Source License

public void clickRemoveFromBlackList() {
    findOne(By.name("remove")).click();
}

From source file:com.hotwire.selenium.tools.c3.customer.C3ShareItineraryForm.java

License:Open Source License

public C3ShareItineraryForm(WebDriver webdriver) {
    super(webdriver, By.name("shareThisItineraryForm"));
}