Example usage for org.openqa.selenium.support.ui Wait until

List of usage examples for org.openqa.selenium.support.ui Wait until

Introduction

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

Prototype

<T> T until(Function<? super F, T> isTrue);

Source Link

Document

Implementations should wait until the condition evaluates to a value that is neither null nor false.

Usage

From source file:test.nov21.configuration.AbstractPage.java

License:Open Source License

public WebElement waitForExpectedElement(final By by, int timeout) {
    Wait<WebDriver> wait = new WebDriverWait(getDriver(), timeout);
    wait.until(visibilityOfElementLocated(by));
    return getDriver().findElement(by);
}

From source file:test.nov21.configuration.AbstractPage.java

License:Open Source License

public List<WebElement> waitForExpectedElements(final By by, int timeout) {
    Wait<WebDriver> wait = new WebDriverWait(getDriver(), timeout);
    wait.until(ExpectedConditions.presenceOfAllElementsLocatedBy(by));
    return getDriver().findElements(by);
}

From source file:test.nov21.configuration.AbstractPage.java

License:Open Source License

public List<WebElement> waitForElementsVisible(final By by, int timeout) {
    Wait<WebDriver> wait = new WebDriverWait(getDriver(), timeout);
    return wait.until(ExpectedConditions.visibilityOfAllElementsLocatedBy(by));
}

From source file:test.nov21.configuration.AbstractPage.java

License:Open Source License

public WebElement waitForElementPresent(final By by) {
    Wait<WebDriver> wait = new WebDriverWait(getDriver(), DRIVER_WAIT_TIME);
    return wait.until(ExpectedConditions.presenceOfElementLocated(by));
}

From source file:test.nov21.configuration.AbstractPage.java

License:Open Source License

public WebElement waitForElementVisible(final By by) {
    Wait<WebDriver> wait = new WebDriverWait(getDriver(), DRIVER_WAIT_TIME);
    wait.until(ExpectedConditions.visibilityOfElementLocated(by));
    return getDriver().findElement(by);
}

From source file:test.nov21.configuration.AbstractPage.java

License:Open Source License

public WebElement waitForElementVisible(final WebElement element, int timeOut) {
    Wait<WebDriver> wait = new WebDriverWait(getDriver(), timeOut);
    wait.until(ExpectedConditions.visibilityOf(element));
    return element;
}

From source file:test.nov21.configuration.AbstractPage.java

License:Open Source License

public void waitForTextPresent(final By by, String txt, int timeOut) {
    LOG.info("waiting for the text " + txt + " to be present... ");
    Wait<WebDriver> wait = new WebDriverWait(getDriver(), timeOut);
    wait.until(ExpectedConditions.textToBePresentInElementLocated(by, txt));
}

From source file:test.nov21.configuration.AbstractPage.java

License:Open Source License

public WebElement waitForElementToBeClickableAndReturnElement(final By by) {
    Wait<WebDriver> wait = new WebDriverWait(getDriver(), DRIVER_WAIT_TIME, 100);
    wait.until(ExpectedConditions.elementToBeClickable(by));
    return getDriver().findElement(by);
}

From source file:test.nov21.configuration.AbstractPage.java

License:Open Source License

public List<WebElement> waitForElementsToBeClickableAndReturnElement(final By by) {
    Wait<WebDriver> wait = new WebDriverWait(getDriver(), DRIVER_WAIT_TIME, 100);
    wait.until(ExpectedConditions.elementToBeClickable(by));
    return getDriver().findElements(by);
}

From source file:test.nov21.configuration.AbstractPage.java

License:Open Source License

public WebElement waitForElementToBeClickable(final WebElement element) {
    Wait<WebDriver> wait = new WebDriverWait(getDriver(), DRIVER_WAIT_TIME, 100);
    wait.until(ExpectedConditions.elementToBeClickable(element));
    return element;
}