Annotation Type SeleniumElement


  • @Target(FIELD)
    @Retention(RUNTIME)
    public @interface SeleniumElement
    Binds the annotated field as a Selenium element. A getter is generated which returns the field's type.

    Usage example:
     
     @Page
     class MyPage {
     
       @SeleniumElement(id="TestText")
       TextField testText
     
     }
      
    Leads to:
     
     @Page
     public class MyPage {
       @SeleniumElement(id="TestText")
       private TextField testText;
     
       public TextField getTestText() {
         return testText;
       }
     }
      
    Since:
    2.0.0
    Author:
    Oliver Libutzki <[email protected]>
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      java.lang.String className
      Find elements based on the value of the "class" attribute.
      java.lang.String css
      Find elements via the driver's underlying W3 Selector engine.
      java.lang.String id
      Locate elements by the value of the "id" attribute.
      java.lang.String linkText
      Locate elements by the exact text they display.
      java.lang.String name
      Locate elements by the value of the "name" attribute.
      java.lang.String partialLinkText
      Locate elements that contain the given link text.
      java.lang.String tagName
      Locate elements by their tag name.
      java.lang.String xpath
      Locate elements via XPath.
    • Element Detail

      • id

        java.lang.String id
        Locate elements by the value of the "id" attribute.
        Returns:
        the value of the "id" attribute to search for
        Since:
        2.0.0
        Default:
        ""
      • name

        java.lang.String name
        Locate elements by the value of the "name" attribute.
        Returns:
        the value of the "name" attribute to search for
        Since:
        2.0.0
        Default:
        ""
      • className

        java.lang.String className
        Find elements based on the value of the "class" attribute. If an element has many classes then this will match against each of them. For example if the value is "one two onone", then the following "className"s will match: "one" and "two"
        Returns:
        the value of the "class" attribute to search for
        Since:
        2.0.0
        Default:
        ""
      • css

        java.lang.String css
        Find elements via the driver's underlying W3 Selector engine. If the browser does not implement the Selector API, a best effort is made to emulate the API. In this case, we strive for at least CSS2 support, but offer no guarantees.
        Returns:
        the selector css expression
        Since:
        2.0.0
        Default:
        ""
      • tagName

        java.lang.String tagName
        Locate elements by their tag name.
        Returns:
        the element's tag name
        Since:
        2.0.0
        Default:
        ""
      • linkText

        java.lang.String linkText
        Locate elements by the exact text they display.
        Returns:
        the exact text to match against
        Since:
        2.0.0
        Default:
        ""
      • partialLinkText

        java.lang.String partialLinkText
        Locate elements that contain the given link text.
        Returns:
        the text to match against
        Since:
        2.0.0
        Default:
        ""
      • xpath

        java.lang.String xpath
        Locate elements via XPath.
        Returns:
        the xpath to use
        Since:
        2.0.0
        Default:
        ""