public class AjaxElementLocator extends DefaultElementLocator
isElementUsable(WebElement)
if this is important to you.
Because this class polls the interface on a regular basis, it is strongly recommended that users
avoid locating elements by XPath.Modifier and Type | Field and Description |
---|---|
protected int |
timeOutInSeconds |
Constructor and Description |
---|
AjaxElementLocator(Clock clock,
org.openqa.selenium.SearchContext searchContext,
Field field,
int timeOutInSeconds) |
AjaxElementLocator(Clock clock,
org.openqa.selenium.SearchContext context,
int timeOutInSeconds,
AbstractAnnotations annotations) |
AjaxElementLocator(org.openqa.selenium.SearchContext searchContext,
Field field,
int timeOutInSeconds)
Main constructor.
|
AjaxElementLocator(org.openqa.selenium.SearchContext context,
int timeOutInSeconds,
AbstractAnnotations annotations)
Use this constructor in order to process custom annotaions.
|
Modifier and Type | Method and Description |
---|---|
org.openqa.selenium.WebElement |
findElement()
Find the element.
|
List<org.openqa.selenium.WebElement> |
findElements()
Find the element list.
|
protected boolean |
isElementUsable(org.openqa.selenium.WebElement element)
By default, elements are considered "found" if they are in the DOM.
|
protected long |
sleepFor()
By default, we sleep for 250ms between polls.
|
toString
public AjaxElementLocator(org.openqa.selenium.SearchContext context, int timeOutInSeconds, AbstractAnnotations annotations)
context
- The context to use when finding the elementtimeOutInSeconds
- How long to wait for the element to appear. Measured in seconds.annotations
- AbstractAnnotations class implementationpublic AjaxElementLocator(Clock clock, org.openqa.selenium.SearchContext context, int timeOutInSeconds, AbstractAnnotations annotations)
public AjaxElementLocator(org.openqa.selenium.SearchContext searchContext, Field field, int timeOutInSeconds)
searchContext
- The context to use when finding the elementfield
- The field representing this elementtimeOutInSeconds
- How long to wait for the element to appear. Measured in seconds.public org.openqa.selenium.WebElement findElement()
findElement
in interface ElementLocator
findElement
in class DefaultElementLocator
public List<org.openqa.selenium.WebElement> findElements()
findElements
in interface ElementLocator
findElements
in class DefaultElementLocator
protected long sleepFor()
protected boolean isElementUsable(org.openqa.selenium.WebElement element)
return element.isDisplayed();
element
- The element to useCopyright © 2016. All rights reserved.