public class FluentWait extends 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(long duration)
Configure wait timeout for this wait object.
|
FluentWait |
atMost(long duration,
TimeUnit unit)
Configure timeout for this wait object.
|
FluentWait |
explicitlyFor(long amount)
Waits unconditionally for an explicit amount of time.
|
FluentWait |
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 object
|
boolean |
hasMessageDefined()
Check if a message is defined.
|
FluentWait |
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.
|
FluentWait |
ignoring(Class<? extends RuntimeException> exceptionType)
Add given exception to ignore list to avoid breaking the wait when they occurs in the underlying condition evaluation.
|
FluentWait |
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.
|
FluentWait |
pollingEvery(long duration)
Configure polling time for this wait object.
|
FluentWait |
pollingEvery(long duration,
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(com.google.common.base.Function<? super FluentControl,T> function)
Wait until the function returns a non-null and non-false object.
|
FluentListConditions |
until(List<? extends FluentWebElement> elements)
Get a conditions object used to wait for a condition on given elements.
|
void |
until(com.google.common.base.Supplier<Boolean> booleanSupplier)
Wait until the supplier returns true.
|
FluentListConditions |
untilEach(List<? extends FluentWebElement> elements)
Get a conditions object used to wait for a condition on given elements.
|
FluentListConditions |
untilEachElements(com.google.common.base.Supplier<? extends List<? extends FluentWebElement>> elements)
Get a conditions object used to wait for a condition on given elements.
|
FluentConditions |
untilElement(com.google.common.base.Supplier<? extends FluentWebElement> element)
Get a conditions object used to wait for a condition on given element.
|
FluentListConditions |
untilElements(com.google.common.base.Supplier<? extends 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(com.google.common.base.Predicate<FluentControl> predicate)
Wait until the predicate returns true.
|
FluentWaitWindowConditions |
untilWindow(String windowName)
Get a condition object used to wait for a window condition.
|
FluentWait |
withMessage(String message)
Configures a custom message to be used if the condition fails during the timeout duration.
|
FluentWait |
withMessage(com.google.common.base.Supplier<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(long duration, 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(long duration, 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(Collection<Class<? extends Throwable>> types)
FluentWaitConfigurationignoreAll in interface FluentWaitConfiguration<FluentWait>types - collection of exception type to ignorethis object to chain method callspublic FluentWait ignoring(Class<? extends RuntimeException> exceptionType)
FluentWaitConfigurationignoring in interface FluentWaitConfiguration<FluentWait>exceptionType - exception type to ignorethis object to chain method callspublic FluentWait ignoring(Class<? extends RuntimeException> firstType, Class<? extends RuntimeException> secondType)
FluentWaitConfigurationignoring in interface FluentWaitConfiguration<FluentWait>firstType - exception type to ignoresecondType - exception type to ignorethis object to chain method callspublic FluentWait withMessage(String message)
FluentWaitConfigurationwithMessage in interface FluentWaitConfiguration<FluentWait>message - failing messagethis object to chain method callspublic FluentWait withMessage(com.google.common.base.Supplier<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(com.google.common.base.Predicate<FluentControl> predicate)
FluentWaitFunctionaluntilPredicate in interface FluentWaitFunctional<FluentControl>predicate - predicate condition to wait forpublic void until(com.google.common.base.Supplier<Boolean> booleanSupplier)
FluentWaitFunctionaluntil in interface FluentWaitFunctional<FluentControl>booleanSupplier - supplier condition to wait for.public <T> T until(com.google.common.base.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(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(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(com.google.common.base.Supplier<? extends FluentWebElement> element)
FluentWaitConditionsuntilElement in interface FluentWaitConditions<FluentWait>element - element to wait forpublic FluentListConditions untilElements(com.google.common.base.Supplier<? extends 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(com.google.common.base.Supplier<? extends 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(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, 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 © 2016 FluentLenium. All Rights Reserved.