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