public class FluentWait extends java.lang.Object implements FluentWaitFunctional<FluentControl>, FluentWaitConditions<FluentWait>, FluentWaitConfiguration<FluentWait>
FluentWait object into a more
complete API, allowing to wait for any condition to be verified.| Constructor and Description |
|---|
FluentWait(FluentControl control)
Creates a new fluent wait.
|
| Modifier and Type | Method and Description |
|---|---|
FluentWait |
atMost(java.time.Duration duration)
Configure timeout for this wait object.
|
FluentWait |
atMost(long duration)
Configure wait timeout for this wait object.
|
FluentWait |
atMost(long duration,
java.util.concurrent.TimeUnit unit)
Configure timeout for this wait object.
|
FluentWait |
explicitlyFor(long amount)
Waits unconditionally for an explicit amount of time.
|
FluentWait |
explicitlyFor(long amount,
java.util.concurrent.TimeUnit timeUnit)
Waits unconditionally for an explicit amount of time.
|
org.openqa.selenium.support.ui.FluentWait |
getWait()
Get the underlying selenium wait object
|
boolean |
hasMessageDefined()
Check if a message is defined.
|
FluentWait |
ignoreAll(java.util.Collection<java.lang.Class<? extends java.lang.Throwable>> types)
Add given exceptions to ignore list to avoid breaking the wait when they occurs in the underlying condition evaluation.
|
FluentWait |
ignoring(java.lang.Class<? extends java.lang.RuntimeException> exceptionType)
Add given exception to ignore list to avoid breaking the wait when they occurs in the underlying condition evaluation.
|
FluentWait |
ignoring(java.lang.Class<? extends java.lang.RuntimeException> firstType,
java.lang.Class<? extends java.lang.RuntimeException> secondType)
Add given exceptions to ignore list to avoid breaking the wait when they occurs in the underlying condition evaluation.
|
FluentWait |
pollingEvery(java.time.Duration duration)
Configure polling time for this wait object.
|
FluentWait |
pollingEvery(long duration)
Configure polling time for this wait object.
|
FluentWait |
pollingEvery(long duration,
java.util.concurrent.TimeUnit unit)
Configure polling time for this wait object.
|
FluentConditions |
until(FluentWebElement element)
Get a conditions object used to wait for condition on given element.
|
<T> T |
until(java.util.function.Function<? super FluentControl,T> function)
Wait until the function returns a non-null and non-false object.
|
FluentListConditions |
until(java.util.List<? extends FluentWebElement> elements)
Get a conditions object used to wait for a condition on given elements.
|
void |
until(java.util.function.Supplier<java.lang.Boolean> booleanSupplier)
Wait until the supplier returns true.
|
FluentListConditions |
untilEach(java.util.List<? extends FluentWebElement> elements)
Get a conditions object used to wait for a condition on given elements.
|
FluentListConditions |
untilEachElements(java.util.function.Supplier<? extends java.util.List<? extends FluentWebElement>> elements)
Get a conditions object used to wait for a condition on given elements.
|
FluentConditions |
untilElement(java.util.function.Supplier<? extends FluentWebElement> element)
Get a conditions object used to wait for a condition on given element.
|
FluentListConditions |
untilElements(java.util.function.Supplier<? extends java.util.List<? extends FluentWebElement>> elements)
Get a conditions object used to wait for a condition on given elements.
|
FluentWaitPageConditions |
untilPage()
Get a condition object used to wait for a page condition.
|
FluentWaitPageConditions |
untilPage(FluentPage page)
Get a condition object used to wait for a page condition.
|
void |
untilPredicate(java.util.function.Predicate<FluentControl> predicate)
Wait until the predicate returns true.
|
FluentWaitWindowConditions |
untilWindow(java.lang.String windowName)
Get a condition object used to wait for a window condition.
|
FluentWait |
withMessage(java.lang.String message)
Configures a custom message to be used if the condition fails during the timeout duration.
|
FluentWait |
withMessage(java.util.function.Supplier<java.lang.String> message)
Configures a custom message supplier to be used if the condition fails during the timeout duration.
|
FluentWait |
withNoDefaultsException()
Removes default exceptions from exceptions ignore list.
|
public FluentWait(FluentControl control)
control - control interfacepublic org.openqa.selenium.support.ui.FluentWait getWait()
FluentWaitConfigurationgetWait in interface FluentWaitConfiguration<FluentWait>public FluentWait atMost(java.time.Duration duration)
FluentWaitConfigurationatMost in interface FluentWaitConfiguration<FluentWait>duration - durationthis object to chain method callspublic FluentWait atMost(long duration, java.util.concurrent.TimeUnit unit)
FluentWaitConfigurationatMost in interface FluentWaitConfiguration<FluentWait>duration - durationunit - time unitthis object to chain method callspublic FluentWait atMost(long duration)
FluentWaitConfigurationatMost in interface FluentWaitConfiguration<FluentWait>duration - duration in millisecondthis object to chain method callspublic FluentWait pollingEvery(java.time.Duration duration)
FluentWaitConfigurationpollingEvery in interface FluentWaitConfiguration<FluentWait>duration - duration between each condition invocationthis object to chain method callspublic FluentWait pollingEvery(long duration, java.util.concurrent.TimeUnit unit)
FluentWaitConfigurationpollingEvery in interface FluentWaitConfiguration<FluentWait>duration - duration between each condition invocationunit - time unitthis object to chain method callspublic FluentWait pollingEvery(long duration)
FluentWaitConfigurationpollingEvery in interface FluentWaitConfiguration<FluentWait>duration - duration in millisecond between each condition invocationthis object to chain method callspublic FluentWait ignoreAll(java.util.Collection<java.lang.Class<? extends java.lang.Throwable>> types)
FluentWaitConfigurationignoreAll in interface FluentWaitConfiguration<FluentWait>types - collection of exception type to ignorethis object to chain method callspublic FluentWait ignoring(java.lang.Class<? extends java.lang.RuntimeException> exceptionType)
FluentWaitConfigurationignoring in interface FluentWaitConfiguration<FluentWait>exceptionType - exception type to ignorethis object to chain method callspublic FluentWait ignoring(java.lang.Class<? extends java.lang.RuntimeException> firstType, java.lang.Class<? extends java.lang.RuntimeException> secondType)
FluentWaitConfigurationignoring in interface FluentWaitConfiguration<FluentWait>firstType - exception type to ignoresecondType - exception type to ignorethis object to chain method callspublic FluentWait withMessage(java.lang.String message)
FluentWaitConfigurationwithMessage in interface FluentWaitConfiguration<FluentWait>message - failing messagethis object to chain method callspublic FluentWait withMessage(java.util.function.Supplier<java.lang.String> message)
FluentWaitConfigurationwithMessage in interface FluentWaitConfiguration<FluentWait>message - failing messagethis object to chain method callspublic FluentWait withNoDefaultsException()
FluentWaitConfigurationwithNoDefaultsException in interface FluentWaitConfiguration<FluentWait>this object to chain method callspublic boolean hasMessageDefined()
hasMessageDefined in interface FluentWaitConfiguration<FluentWait>public void untilPredicate(java.util.function.Predicate<FluentControl> predicate)
FluentWaitFunctionaluntilPredicate in interface FluentWaitFunctional<FluentControl>predicate - predicate condition to wait forpublic void until(java.util.function.Supplier<java.lang.Boolean> booleanSupplier)
FluentWaitFunctionaluntil in interface FluentWaitFunctional<FluentControl>booleanSupplier - supplier condition to wait for.public <T> T until(java.util.function.Function<? super FluentControl,T> function)
FluentWaitFunctionaluntil in interface FluentWaitFunctional<FluentControl>until in interface org.openqa.selenium.support.ui.Wait<FluentControl>T - type of returned objectfunction - function returning a non-null and non-false object when condition is verified.public FluentConditions until(FluentWebElement element)
FluentWaitConditionsuntil in interface FluentWaitConditions<FluentWait>element - element to wait forpublic FluentListConditions until(java.util.List<? extends FluentWebElement> elements)
FluentWaitConditionsAt least one element must verify the condition to be verified.
until in interface FluentWaitConditions<FluentWait>elements - elements to wait forpublic FluentListConditions untilEach(java.util.List<? extends FluentWebElement> elements)
FluentWaitConditionsEach element must verify the condition to be verified.
untilEach in interface FluentWaitConditions<FluentWait>elements - elements to wait forpublic FluentConditions untilElement(java.util.function.Supplier<? extends FluentWebElement> element)
FluentWaitConditionsuntilElement in interface FluentWaitConditions<FluentWait>element - element to wait forpublic FluentListConditions untilElements(java.util.function.Supplier<? extends java.util.List<? extends FluentWebElement>> elements)
FluentWaitConditionsAt least one element must verify the condition to be verified.
untilElements in interface FluentWaitConditions<FluentWait>elements - elements to wait forpublic FluentListConditions untilEachElements(java.util.function.Supplier<? extends java.util.List<? extends FluentWebElement>> elements)
FluentWaitConditionsEach element must verify the condition to be verified.
untilEachElements in interface FluentWaitConditions<FluentWait>elements - elements to wait forpublic FluentWaitWindowConditions untilWindow(java.lang.String windowName)
FluentWaitConditionsuntilWindow in interface FluentWaitConditions<FluentWait>windowName - name of the window to wait forpublic FluentWaitPageConditions untilPage()
FluentWaitConditionsuntilPage in interface FluentWaitConditions<FluentWait>public FluentWaitPageConditions untilPage(FluentPage page)
FluentWaitConditionsuntilPage in interface FluentWaitConditions<FluentWait>page - page to wait forpublic FluentWait explicitlyFor(long amount, java.util.concurrent.TimeUnit timeUnit)
FluentWaitConditionsThe 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.
explicitlyFor in interface FluentWaitConditions<FluentWait>amount - amount of timetimeUnit - unit of timethis object to chain method callspublic FluentWait explicitlyFor(long amount)
FluentWaitConditionsThe 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.
explicitlyFor in interface FluentWaitConditions<FluentWait>amount - amount of time to wait in millisecondsthis object to chain method callsCopyright © 2018 FluentLenium. All Rights Reserved.