Class SmartAjaxElementLocator
java.lang.Object
net.thucydides.core.annotations.locators.SmartElementLocator
net.thucydides.core.annotations.locators.SmartAjaxElementLocator
- All Implemented Interfaces:
WithConfigurableTimeout,org.openqa.selenium.support.pagefactory.ElementLocator
-
Constructor Summary
ConstructorsConstructorDescriptionSmartAjaxElementLocator(org.openqa.selenium.SearchContext searchContext, Field field, MobilePlatform platform) Main constructor. -
Method Summary
Modifier and TypeMethodDescriptionorg.openqa.selenium.WebElementWill poll the interface on a regular basis until the element is present.org.openqa.selenium.WebElementFind the element.org.openqa.selenium.WebElementList<org.openqa.selenium.WebElement>Will poll the interface on a regular basis until at least one element is present.voidsetTimeOutInSeconds(int timeOutInSeconds) Deprecated.protected longsleepFor()By default, we sleep for 250ms between polls.toString()
-
Constructor Details
-
SmartAjaxElementLocator
public SmartAjaxElementLocator(org.openqa.selenium.SearchContext searchContext, Field field, MobilePlatform platform) Main constructor.- Parameters:
searchContext- The SearchContext to use when locating elementsfield- The field representing this element
-
-
Method Details
-
findElement
public org.openqa.selenium.WebElement findElement()Description copied from class:SmartElementLocatorFind the element.- Specified by:
findElementin interfaceorg.openqa.selenium.support.pagefactory.ElementLocator- Overrides:
findElementin classSmartElementLocator
-
setTimeOutInSeconds
Deprecated.- Specified by:
setTimeOutInSecondsin interfaceWithConfigurableTimeout
-
findElementImmediately
public org.openqa.selenium.WebElement findElementImmediately() -
ajaxFindElement
public org.openqa.selenium.WebElement ajaxFindElement()Will poll the interface on a regular basis until the element is present. -
findElements
Will poll the interface on a regular basis until at least one element is present.- Specified by:
findElementsin interfaceorg.openqa.selenium.support.pagefactory.ElementLocator- Overrides:
findElementsin classSmartElementLocator
-
sleepFor
protected long sleepFor()By default, we sleep for 250ms between polls. You may override this method in order to change how it sleeps.- Returns:
- Duration to sleep in milliseconds
-
toString
-