Example usage for org.openqa.selenium.support.ui ExpectedConditions presenceOfElementLocated

List of usage examples for org.openqa.selenium.support.ui ExpectedConditions presenceOfElementLocated

Introduction

In this page you can find the example usage for org.openqa.selenium.support.ui ExpectedConditions presenceOfElementLocated.

Prototype

public static ExpectedCondition<WebElement> presenceOfElementLocated(final By locator) 

Source Link

Document

An expectation for checking that an element is present on the DOM of a page.

Usage

From source file:com.hotwire.selenium.desktop.us.billing.car.impl.accordion.AcPaymentMethodFragment.java

License:Open Source License

public WebElement getSavedVisaButton() {
    return new WebDriverWait(getWebDriver(), 3)
            .until(ExpectedConditions.presenceOfElementLocated(By.xpath(xpathSavedVisaRbtn)));
}

From source file:com.hotwire.selenium.desktop.us.billing.car.impl.ccf.CcfDetailsFragment.java

License:Open Source License

@Override
public String[] getSelectedVendorGridEntity() {
    return getVendorAsArray(new WebDriverWait(getWebDriver(), MAX_SEARCH_PAGE_WAIT_SECONDS)
            .until(ExpectedConditions.presenceOfElementLocated(
                    By.xpath("//div[@id='tileName-vendorGrid']//a[contains(@class, 'vendor  selected')]"))));
}

From source file:com.hotwire.selenium.desktop.us.partners.CarBookingBuddyPage.java

License:Open Source License

public CarBookingBuddyPage(WebDriver webdriver) {
    super(webdriver);

    new WebDriverWait(webdriver, 10)
            .until(ExpectedConditions.presenceOfElementLocated(By.cssSelector(".bookingbuddy_com")));
}

From source file:com.hotwire.selenium.desktop.us.partners.CarExpediaPage.java

License:Open Source License

public CarExpediaPage(WebDriver webdriver) {
    super(webdriver);

    new WebDriverWait(webdriver, 10).until(
            ExpectedConditions.presenceOfElementLocated(By.cssSelector("div.searchtitle, div#playback-pane")));
}

From source file:com.hotwire.selenium.desktop.us.partners.CarRentalsPage.java

License:Open Source License

public CarRentalsPage(WebDriver webdriver) {
    super(webdriver);

    new WebDriverWait(webdriver, 10)
            .until(ExpectedConditions.presenceOfElementLocated(By.cssSelector("#tile-fareFinder, #location")));
}

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

License:Open Source License

public void makeVisibleFareFinder() {
    new WebDriverWait(getWebDriver(), DEFAULT_WAIT).until(
            ExpectedConditions.presenceOfElementLocated(By.cssSelector(HotelSearchFragment.SEARCH_BUTTON)));
    if (!getWebDriver().findElement(By.cssSelector(HotelSearchFragment.SEARCH_BUTTON)).isDisplayed()) {
        this.getEditSearch().click();
    }/*w  ww .  j a  v  a2 s  .c o m*/
}

From source file:com.hotwire.selenium.desktop.widget.DropDownSelector.java

License:Open Source License

public DropDownSelector(WebDriver webDriver, By selector) {
    new WebDriverWait(webDriver, TIMEOUT).until(ExpectedConditions.presenceOfElementLocated(selector));
    this.webDriver = webDriver;
    this.nativeDropDown = webDriver.findElement(selector);
}

From source file:com.hotwire.selenium.tools.c3.casenotes.C3CaseNotesFrame.java

License:Open Source License

public String getErrorMessage() {
    return new WebDriverWait(getWebDriver(), 5)
            .until(ExpectedConditions.presenceOfElementLocated(By.cssSelector(ERROR_MESSAGE_CSS))).getText();
}

From source file:com.hotwire.selenium.tools.c3.casenotes.C3CaseNotesFrame.java

License:Open Source License

public Boolean checkCaseNotesCreated(String text) {
    try {/*from  w  w  w.j  a v a  2s  .co m*/
        new WebDriverWait(getWebDriver(), 1).until(ExpectedConditions
                .presenceOfElementLocated(By.xpath("//DIV[contains(text(), '" + text + "')]")));
        return true;
    } catch (TimeoutException e) {
        return false;
    }
}

From source file:com.hotwire.selenium.tools.c3.refund.C3AirRefundPage.java

License:Open Source License

@Override
public void proceedPartialRefund() {
    clickRefund();/*from   w w  w. j  a v a 2s.  c o  m*/
    try {
        getWebDriver().switchTo().alert().accept();
    } catch (Exception e) {
        logger.info("There are no alert window");
    }
    try {
        new WebDriverWait(getWebDriver(), 5)
                .until(ExpectedConditions.presenceOfElementLocated(By.name("newResNum"))).sendKeys("#wwwwww");
        new WebDriverWait(getWebDriver(), 5)
                .until(ExpectedConditions.presenceOfElementLocated(By.name("continue"))).click();
    } catch (Exception e) {
        logger.info("just waiting expected error message");
    }
}