Example usage for org.openqa.selenium.support.ui FluentWait ignoreAll

List of usage examples for org.openqa.selenium.support.ui FluentWait ignoreAll

Introduction

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

Prototype

public <K extends Throwable> FluentWait<T> ignoreAll(Collection<Class<? extends K>> types) 

Source Link

Document

Configures this instance to ignore specific types of exceptions while waiting for a condition.

Usage

From source file:org.nuxeo.functionaltests.Locator.java

License:Apache License

/**
 * Fluent wait on a the given function, checking every 100 ms.
 *
 * @param function/*ww  w . j  ava 2 s. c  o m*/
 * @param ignoredExceptions the types of exceptions to ignore.
 * @since 5.9.2
 */
@SafeVarargs
public static <K extends java.lang.Throwable> void waitUntilGivenFunctionIgnoreAll(
        Function<WebDriver, Boolean> function, java.lang.Class<? extends K>... ignoredExceptions) {
    FluentWait<WebDriver> wait = getFluentWait();
    if (ignoredExceptions != null) {
        if (ignoredExceptions.length == 1) {
            wait.ignoring(ignoredExceptions[0]);
        } else {
            wait.ignoreAll(Arrays.asList(ignoredExceptions));
        }

    }
    wait.until(function);
}