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
ConstructorDescriptionFluentWaitElementList
(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.FluentWait
getWait()
Get the underlying selenium wait objectboolean
Check 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.<T> T
until
(Function<? super FluentControl, T> function) Deprecated.void
Wait until the supplier returns true.until
(List<? extends FluentWebElement> elements) Get a conditions object used to wait for a condition on given elements.until
(FluentWebElement element) Get a conditions object used to wait for condition on given element.untilAsserted
(Runnable block) waits until aRunnable
block 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.void
untilPredicate
(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, wait
Methods inherited from interface io.fluentlenium.core.wait.FluentWaitConditions
explicitlyFor
Methods 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:FluentWaitConfiguration
Get the underlying selenium wait object- Specified by:
getWait
in interfaceFluentWaitConfiguration<FluentWaitElementList>
- Returns:
- selenium wait
-
atMost
Description copied from interface:FluentWaitConfiguration
Configure timeout for this wait object.- Specified by:
atMost
in interfaceFluentWaitConfiguration<FluentWaitElementList>
- Parameters:
duration
- duration- Returns:
this
object to chain method calls
-
pollingEvery
Description copied from interface:FluentWaitConfiguration
Configure polling time for this wait object.- Specified by:
pollingEvery
in interfaceFluentWaitConfiguration<FluentWaitElementList>
- Parameters:
duration
- duration between each condition invocation- Returns:
this
object to chain method calls
-
ignoreAll
Description copied from interface:FluentWaitConfiguration
Add given exceptions to ignore list to avoid breaking the wait when they occurs in the underlying condition evaluation.- Specified by:
ignoreAll
in interfaceFluentWaitConfiguration<FluentWaitElementList>
- Parameters:
types
- collection of exception type to ignore- Returns:
this
object to chain method calls
-
ignoring
Description copied from interface:FluentWaitConfiguration
Add given exception to ignore list to avoid breaking the wait when they occurs in the underlying condition evaluation.- Specified by:
ignoring
in interfaceFluentWaitConfiguration<FluentWaitElementList>
- Parameters:
exceptionType
- exception type to ignore- Returns:
this
object to chain method calls
-
ignoring
public FluentWaitElementList ignoring(Class<? extends RuntimeException> firstType, Class<? extends RuntimeException> secondType) Description copied from interface:FluentWaitConfiguration
Add given exceptions to ignore list to avoid breaking the wait when they occurs in the underlying condition evaluation.- Specified by:
ignoring
in interfaceFluentWaitConfiguration<FluentWaitElementList>
- Parameters:
firstType
- exception type to ignoresecondType
- exception type to ignore- Returns:
this
object to chain method calls
-
untilPredicate
Description copied from interface:FluentWaitFunctional
Wait until the predicate returns true.- Specified by:
untilPredicate
in interfaceFluentWaitFunctional<FluentControl>
- Parameters:
predicate
- predicate condition to wait for
-
until
Description copied from interface:FluentWaitFunctional
Wait until the supplier returns true.- Specified by:
until
in interfaceFluentWaitFunctional<FluentControl>
- Parameters:
supplier
- supplier condition to wait for.
-
withMessage
Description copied from interface:FluentWaitConfiguration
Configures a custom message supplier to be used if the condition fails during the timeout duration.- Specified by:
withMessage
in interfaceFluentWaitConfiguration<FluentWaitElementList>
- Parameters:
message
- failing message- Returns:
this
object to chain method calls
-
hasMessageDefined
public boolean hasMessageDefined()Description copied from interface:FluentWaitConfiguration
Check if a message is defined.- Specified by:
hasMessageDefined
in interfaceFluentWaitConfiguration<FluentWaitElementList>
- Returns:
- true if this fluent wait use a custom message, false otherwise
-
withNoDefaultsException
Description copied from interface:FluentWaitConfiguration
Removes default exceptions from exceptions ignore list.- Specified by:
withNoDefaultsException
in interfaceFluentWaitConfiguration<FluentWaitElementList>
- Returns:
this
object to chain method calls
-
until
Description copied from interface:FluentWaitConditions
Get a conditions object used to wait for condition on given element.- Specified by:
until
in interfaceFluentWaitConditions<FluentWaitElementList>
- Parameters:
element
- element to wait for- Returns:
- conditions object
-
until
Description copied from interface:FluentWaitConditions
Get 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:
until
in interfaceFluentWaitConditions<FluentWaitElementList>
- Parameters:
elements
- elements to wait for- Returns:
- conditions object
-
untilEach
Description copied from interface:FluentWaitConditions
Get a conditions object used to wait for a condition on given elements.Each element must verify the condition to be verified.
- Specified by:
untilEach
in interfaceFluentWaitConditions<FluentWaitElementList>
- Parameters:
elements
- elements to wait for- Returns:
- conditions object
-
untilElement
Description copied from interface:FluentWaitConditions
Get a conditions object used to wait for a condition on given element.- Specified by:
untilElement
in 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:FluentWaitConditions
Get 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:
untilElements
in 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:FluentWaitConditions
Get a conditions object used to wait for a condition on given elements.Each element must verify the condition to be verified.
- Specified by:
untilEachElements
in interfaceFluentWaitConditions<FluentWaitElementList>
- Parameters:
selector
- elements to wait for- Returns:
- conditions object
-
untilWindow
Description copied from interface:FluentWaitConditions
Get a condition object used to wait for a window condition.- Specified by:
untilWindow
in interfaceFluentWaitConditions<FluentWaitElementList>
- Parameters:
windowName
- name of the window to wait for- Returns:
- window conditions object
-
untilPage
Description copied from interface:FluentWaitConditions
Get a condition object used to wait for a page condition.- Specified by:
untilPage
in interfaceFluentWaitConditions<FluentWaitElementList>
- Returns:
- page conditions object
-
untilPage
Description copied from interface:FluentWaitConditions
Get a condition object used to wait for a page condition.- Specified by:
untilPage
in interfaceFluentWaitConditions<FluentWaitElementList>
- Parameters:
page
- page to wait for- Returns:
- page conditions object
-
explicitlyFor
Description copied from interface:FluentWaitConditions
Waits 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:
explicitlyFor
in interfaceFluentWaitConditions<FluentWaitElementList>
- Parameters:
amount
- amount of timetimeUnit
- unit of time- Returns:
this
object to chain method calls
-
untilAsserted
Description copied from interface:FluentWaitConditions
waits until aRunnable
block 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:
untilAsserted
in interfaceFluentWaitConditions<FluentWaitElementList>
- Parameters:
block
- the code block that is responsible for executing the assertion and throwing AssertionError on failure.- Returns:
this
object to chain method calls
-
until
Deprecated.Wait until function returns true- Specified by:
until
in interfaceFluentWaitFunctional<FluentControl>
- Specified by:
until
in interfaceorg.openqa.selenium.support.ui.Wait<FluentControl>
- Type Parameters:
T
- FluentWaitElementList- Parameters:
function
- function to be performed- Returns:
- FluentWaitElementList
-