Class FluentWaitElementList
- All Implemented Interfaces:
FluentWaitConditions<FluentWaitElementList>,FluentWaitConfiguration<FluentWaitElementList>,FluentWaitFunctional<FluentControl>,org.openqa.selenium.support.ui.Wait<FluentControl>
FluentWait object into a more
complete API, allowing to wait for any condition to be verified on underlying elements.-
Constructor Summary
ConstructorsConstructorDescriptionFluentWaitElementList(FluentWait controlWait, List<? extends FluentWebElement> elements) Creates a new fluent wait for a given elements. -
Method Summary
Modifier and TypeMethodDescriptionConfigure timeout for this wait object.explicitlyFor(long amount, TimeUnit timeUnit) Waits unconditionally for an explicit amount of time.org.openqa.selenium.support.ui.FluentWaitgetWait()Get the underlying selenium wait objectbooleanCheck if a message is defined.ignoreAll(Collection<Class<? extends Throwable>> types) Add given exceptions to ignore list to avoid breaking the wait when they occurs in the underlying condition evaluation.ignoring(Class<? extends RuntimeException> exceptionType) Add given exception to ignore list to avoid breaking the wait when they occurs in the underlying condition evaluation.ignoring(Class<? extends RuntimeException> firstType, Class<? extends RuntimeException> secondType) Add given exceptions to ignore list to avoid breaking the wait when they occurs in the underlying condition evaluation.pollingEvery(Duration duration) Configure polling time for this wait object.until()Get a conditions object used to wait for condition on current elements.until(FluentWebElement element) Get a conditions object used to wait for condition on given element.<T> Tuntil(Function<? super FluentControl, T> function) Deprecated.voidWait until the supplier returns true.until(List<? extends FluentWebElement> elements) Get a conditions object used to wait for a condition on given elements.untilAsserted(Runnable block) waits until aRunnableblock execution ends without throwing an exception.Get a conditions object used to wait for condition on current elements.untilEach(List<? extends FluentWebElement> elements) Get a conditions object used to wait for a condition on given elements.untilEachElements(Supplier<? extends List<? extends FluentWebElement>> selector) Get a conditions object used to wait for a condition on given elements.untilElement(Supplier<? extends FluentWebElement> selector) Get a conditions object used to wait for a condition on given element.untilElements(Supplier<? extends List<? extends FluentWebElement>> selector) Get a conditions object used to wait for a condition on given elements.Get a condition object used to wait for a page condition.untilPage(FluentPage page) Get a condition object used to wait for a page condition.voiduntilPredicate(Predicate<FluentControl> predicate) Wait until the predicate returns true.untilWindow(String windowName) Get a condition object used to wait for a window condition.withMessage(Supplier<String> message) Configures a custom message supplier to be used if the condition fails during the timeout duration.Removes default exceptions from exceptions ignore list.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.fluentlenium.core.wait.FluentWaitConditions
explicitlyForMethods inherited from interface io.fluentlenium.core.wait.FluentWaitConfiguration
atMost, atMost, pollingEvery, pollingEvery, withMessage
-
Constructor Details
-
FluentWaitElementList
Creates a new fluent wait for a given elements.- Parameters:
controlWait- underlying wait from control interfaceelements- underlying elements
-
-
Method Details
-
until
Get a conditions object used to wait for condition on current elements.At least one element must verify the condition to be verified.
- Returns:
- conditions object
-
untilEach
Get a conditions object used to wait for condition on current elements.Each element must verify the condition to be verified.
- Returns:
- conditions object
-
getWait
public org.openqa.selenium.support.ui.FluentWait getWait()Description copied from interface:FluentWaitConfigurationGet the underlying selenium wait object- Specified by:
getWaitin interfaceFluentWaitConfiguration<FluentWaitElementList>- Returns:
- selenium wait
-
atMost
Description copied from interface:FluentWaitConfigurationConfigure timeout for this wait object.- Specified by:
atMostin interfaceFluentWaitConfiguration<FluentWaitElementList>- Parameters:
duration- duration- Returns:
thisobject to chain method calls
-
pollingEvery
Description copied from interface:FluentWaitConfigurationConfigure polling time for this wait object.- Specified by:
pollingEveryin interfaceFluentWaitConfiguration<FluentWaitElementList>- Parameters:
duration- duration between each condition invocation- Returns:
thisobject to chain method calls
-
ignoreAll
Description copied from interface:FluentWaitConfigurationAdd given exceptions to ignore list to avoid breaking the wait when they occurs in the underlying condition evaluation.- Specified by:
ignoreAllin interfaceFluentWaitConfiguration<FluentWaitElementList>- Parameters:
types- collection of exception type to ignore- Returns:
thisobject to chain method calls
-
ignoring
Description copied from interface:FluentWaitConfigurationAdd given exception to ignore list to avoid breaking the wait when they occurs in the underlying condition evaluation.- Specified by:
ignoringin interfaceFluentWaitConfiguration<FluentWaitElementList>- Parameters:
exceptionType- exception type to ignore- Returns:
thisobject to chain method calls
-
ignoring
public FluentWaitElementList ignoring(Class<? extends RuntimeException> firstType, Class<? extends RuntimeException> secondType) Description copied from interface:FluentWaitConfigurationAdd given exceptions to ignore list to avoid breaking the wait when they occurs in the underlying condition evaluation.- Specified by:
ignoringin interfaceFluentWaitConfiguration<FluentWaitElementList>- Parameters:
firstType- exception type to ignoresecondType- exception type to ignore- Returns:
thisobject to chain method calls
-
untilPredicate
Description copied from interface:FluentWaitFunctionalWait until the predicate returns true.- Specified by:
untilPredicatein interfaceFluentWaitFunctional<FluentControl>- Parameters:
predicate- predicate condition to wait for
-
until
Description copied from interface:FluentWaitFunctionalWait until the supplier returns true.- Specified by:
untilin interfaceFluentWaitFunctional<FluentControl>- Parameters:
supplier- supplier condition to wait for.
-
withMessage
Description copied from interface:FluentWaitConfigurationConfigures a custom message supplier to be used if the condition fails during the timeout duration.- Specified by:
withMessagein interfaceFluentWaitConfiguration<FluentWaitElementList>- Parameters:
message- failing message- Returns:
thisobject to chain method calls
-
hasMessageDefined
public boolean hasMessageDefined()Description copied from interface:FluentWaitConfigurationCheck if a message is defined.- Specified by:
hasMessageDefinedin interfaceFluentWaitConfiguration<FluentWaitElementList>- Returns:
- true if this fluent wait use a custom message, false otherwise
-
withNoDefaultsException
Description copied from interface:FluentWaitConfigurationRemoves default exceptions from exceptions ignore list.- Specified by:
withNoDefaultsExceptionin interfaceFluentWaitConfiguration<FluentWaitElementList>- Returns:
thisobject to chain method calls
-
until
Description copied from interface:FluentWaitConditionsGet a conditions object used to wait for condition on given element.- Specified by:
untilin interfaceFluentWaitConditions<FluentWaitElementList>- Parameters:
element- element to wait for- Returns:
- conditions object
-
until
Description copied from interface:FluentWaitConditionsGet a conditions object used to wait for a condition on given elements.At least one element must verify the condition to be verified.
- Specified by:
untilin interfaceFluentWaitConditions<FluentWaitElementList>- Parameters:
elements- elements to wait for- Returns:
- conditions object
-
untilEach
Description copied from interface:FluentWaitConditionsGet a conditions object used to wait for a condition on given elements.Each element must verify the condition to be verified.
- Specified by:
untilEachin interfaceFluentWaitConditions<FluentWaitElementList>- Parameters:
elements- elements to wait for- Returns:
- conditions object
-
untilElement
Description copied from interface:FluentWaitConditionsGet a conditions object used to wait for a condition on given element.- Specified by:
untilElementin interfaceFluentWaitConditions<FluentWaitElementList>- Parameters:
selector- element to wait for- Returns:
- conditions object
-
untilElements
public FluentListConditions untilElements(Supplier<? extends List<? extends FluentWebElement>> selector) Description copied from interface:FluentWaitConditionsGet a conditions object used to wait for a condition on given elements.At least one element must verify the condition to be verified.
- Specified by:
untilElementsin interfaceFluentWaitConditions<FluentWaitElementList>- Parameters:
selector- elements to wait for- Returns:
- conditions object
-
untilEachElements
public FluentListConditions untilEachElements(Supplier<? extends List<? extends FluentWebElement>> selector) Description copied from interface:FluentWaitConditionsGet a conditions object used to wait for a condition on given elements.Each element must verify the condition to be verified.
- Specified by:
untilEachElementsin interfaceFluentWaitConditions<FluentWaitElementList>- Parameters:
selector- elements to wait for- Returns:
- conditions object
-
untilWindow
Description copied from interface:FluentWaitConditionsGet a condition object used to wait for a window condition.- Specified by:
untilWindowin interfaceFluentWaitConditions<FluentWaitElementList>- Parameters:
windowName- name of the window to wait for- Returns:
- window conditions object
-
untilPage
Description copied from interface:FluentWaitConditionsGet a condition object used to wait for a page condition.- Specified by:
untilPagein interfaceFluentWaitConditions<FluentWaitElementList>- Returns:
- page conditions object
-
untilPage
Description copied from interface:FluentWaitConditionsGet a condition object used to wait for a page condition.- Specified by:
untilPagein interfaceFluentWaitConditions<FluentWaitElementList>- Parameters:
page- page to wait for- Returns:
- page conditions object
-
explicitlyFor
Description copied from interface:FluentWaitConditionsWaits unconditionally for an explicit amount of time.The method should be used only as a last resort.
In most cases you should wait for some condition, e.g. visibility of particular element on the page.
- Specified by:
explicitlyForin interfaceFluentWaitConditions<FluentWaitElementList>- Parameters:
amount- amount of timetimeUnit- unit of time- Returns:
thisobject to chain method calls
-
untilAsserted
Description copied from interface:FluentWaitConditionswaits until aRunnableblock execution ends without throwing an exception.The method is intended to be used with Java 8 Lambda expressions. This allows to use AssertJ/JUnit/TestNG assertions to periodically check for conditions.
await().untilAsserted(() -> assertThat(window().title()).isEqualTo("Fluentlenium"));- Specified by:
untilAssertedin interfaceFluentWaitConditions<FluentWaitElementList>- Parameters:
block- the code block that is responsible for executing the assertion and throwing AssertionError on failure.- Returns:
thisobject to chain method calls
-
until
Deprecated.Wait until function returns true- Specified by:
untilin interfaceFluentWaitFunctional<FluentControl>- Specified by:
untilin interfaceorg.openqa.selenium.support.ui.Wait<FluentControl>- Type Parameters:
T- FluentWaitElementList- Parameters:
function- function to be performed- Returns:
- FluentWaitElementList
-