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

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

Introduction

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

Prototype

public static ExpectedCondition<List<WebElement>> presenceOfAllElementsLocatedBy(final By locator) 

Source Link

Document

An expectation for checking that there is at least one element present on a web page.

Usage

From source file:com.partnet.automation.HtmlView.java

License:Apache License

/**
 * An expectation for checking that there is at least one element present on a
 * web page./* w  w w  .j  a  v a 2 s. c  om*/
 * <p>
 * Use when more that one WebElement could be returned.
 * 
 * @param by locator of the elements searching for
 * @param maxWaitInSeconds max seconds waiting for all elements
 * @return {@link List} of {@link WebElement}
 */
protected List<WebElement> waitForPresenceOfAllElements(By by, int maxWaitInSeconds) {
    return (new WebDriverWait(webDriver, maxWaitInSeconds))
            .until(ExpectedConditions.presenceOfAllElementsLocatedBy(by));
}

From source file:com.pivotal.gemfire.tools.pulse.tests.PulseBaseTests.java

License:Open Source License

public void verifyElementPresentById(String id) {
    WebDriverWait wait = (WebDriverWait) new WebDriverWait(driver, maxWaitTime, 500);
    wait.until(ExpectedConditions.presenceOfAllElementsLocatedBy(By.id(id)));
}

From source file:com.pivotal.gemfire.tools.pulse.tests.PulseBaseTests.java

License:Open Source License

public void verifyElementPresentByLinkText(String lnkText) {
    WebDriverWait wait = (WebDriverWait) new WebDriverWait(driver, maxWaitTime, 500);
    wait.until(ExpectedConditions.presenceOfAllElementsLocatedBy(By.linkText(lnkText)));
}

From source file:com.pivotal.gemfire.tools.pulse.tests.PulseBaseTests.java

License:Open Source License

public void verifyElementPresentByXpath(String xpath) {
    WebDriverWait wait = (WebDriverWait) new WebDriverWait(driver, maxWaitTime, 500);
    wait.until(ExpectedConditions.presenceOfAllElementsLocatedBy(By.xpath(xpath)));
}

From source file:com.vaadin.testbench.elements.NotificationElement.java

License:Apache License

/**
 * Closes a notification./*  www. j a v a2s.  c  om*/
 *
 * @throws TimeoutException
 *             If a notification can not be closed and the timeout expires.
 */
public void close() {
    click();
    WebDriverWait wait = new WebDriverWait(getDriver(), 10);
    wait.until(ExpectedConditions
            .not(ExpectedConditions.presenceOfAllElementsLocatedBy(By.className("v-Notification"))));

}

From source file:com.vmware.gemfire.tools.pulse.tests.PulseBaseTest.java

License:Apache License

public void verifyElementPresentById(String id) {
    WebDriverWait wait = new WebDriverWait(driver, maxWaitTime, 500);
    wait.until(ExpectedConditions.presenceOfAllElementsLocatedBy(By.id(id)));
}

From source file:com.vmware.gemfire.tools.pulse.tests.PulseBaseTest.java

License:Apache License

public void verifyElementPresentByLinkText(String lnkText) {
    WebDriverWait wait = new WebDriverWait(driver, maxWaitTime, 500);
    wait.until(ExpectedConditions.presenceOfAllElementsLocatedBy(By.linkText(lnkText)));
}

From source file:com.vmware.gemfire.tools.pulse.tests.PulseBaseTest.java

License:Apache License

public void verifyElementPresentByXpath(String xpath) {
    WebDriverWait wait = new WebDriverWait(driver, maxWaitTime, 500);
    wait.until(ExpectedConditions.presenceOfAllElementsLocatedBy(By.xpath(xpath)));
}

From source file:com.xwikisas.xcs.test.po.tour.XCSPageWithTour.java

License:Open Source License

@Override
public void previousStep() {
    // Get the current step id
    String stepId = getStepId();//from w  ww .j a v  a 2 s. co m
    // Click
    getDriver().findElement(By.xpath("//button[@data-role='prev']")).click();
    // Wait until current state disappears
    getDriver().waitUntilCondition(
            ExpectedConditions.not(ExpectedConditions.presenceOfAllElementsLocatedBy(By.id(stepId))));
    // Wait until new step appears
    getDriver().waitUntilCondition(ExpectedConditions.presenceOfElementLocated(By.className("tour")));
}

From source file:com.xwikisas.xcs.test.po.tour.XCSPageWithTour.java

License:Open Source License

@Override
public void nextStep() {
    // Get the current step id
    String stepId = getStepId();// w ww .  j a  va2s. com
    // Click
    getDriver().findElement(By.xpath("//button[@data-role='next']")).click();
    // Wait until current state disappears
    getDriver().waitUntilCondition(
            ExpectedConditions.not(ExpectedConditions.presenceOfAllElementsLocatedBy(By.id(stepId))));
    // Wait until new step appear
    getDriver().waitUntilCondition(ExpectedConditions.presenceOfElementLocated(By.className("tour")));
}