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

public class SmartAjaxElementLocator
extends SmartElementLocator
implements WithConfigurableTimeout
  • Constructor Summary

    Constructors
    Constructor Description
    SmartAjaxElementLocator​(org.openqa.selenium.SearchContext searchContext, java.lang.reflect.Field field, MobilePlatform platform)
    Main constructor.
  • Method Summary

    Modifier and Type Method Description
    org.openqa.selenium.WebElement ajaxFindElement()
    Will poll the interface on a regular basis until the element is present.
    org.openqa.selenium.WebElement findElement()
    Find the element.
    org.openqa.selenium.WebElement findElementImmediately()  
    java.util.List<org.openqa.selenium.WebElement> findElements()
    Will poll the interface on a regular basis until at least one element is present.
    void setTimeOutInSeconds​(int timeOutInSeconds)
    Deprecated.
    protected long sleepFor()
    By default, we sleep for 250ms between polls.
    java.lang.String toString()  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • SmartAjaxElementLocator

      public SmartAjaxElementLocator​(org.openqa.selenium.SearchContext searchContext, java.lang.reflect.Field field, MobilePlatform platform)
      Main constructor.
      Parameters:
      searchContext - The SearchContext to use when locating elements
      field - The field representing this element
  • Method Details

    • findElement

      public org.openqa.selenium.WebElement findElement()
      Description copied from class: SmartElementLocator
      Find the element.
      Specified by:
      findElement in interface org.openqa.selenium.support.pagefactory.ElementLocator
      Overrides:
      findElement in class SmartElementLocator
    • setTimeOutInSeconds

      @Deprecated public void setTimeOutInSeconds​(int timeOutInSeconds)
      Deprecated.
      Specified by:
      setTimeOutInSeconds in interface WithConfigurableTimeout
    • 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

      public java.util.List<org.openqa.selenium.WebElement> findElements()
      Will poll the interface on a regular basis until at least one element is present.
      Specified by:
      findElements in interface org.openqa.selenium.support.pagefactory.ElementLocator
      Overrides:
      findElements in class SmartElementLocator
    • 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

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object