Annotation Interface LocateBy


@Retention(RUNTIME) @Target(FIELD) public @interface LocateBy
Annotation that is used to specify how to locate an element. This annotation can be applied to fields to specify the strategy to locate the element.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    com.microsoft.playwright.options.AriaRole
    Returns the AriaRole value specified in the LocateBy annotation.
    Returns the 'How' strategy used to locate an element.
    Returns the pattern used to locate an element.
    Returns the value of the "value" parameter of the annotation.
  • Element Details

    • how

      How how
      Returns the 'How' strategy used to locate an element.
      Returns:
      The 'How' strategy used to locate an element.
      Default:
      UNSET
    • value

      String value
      Returns the value of the "value" parameter of the annotation.
      Returns:
      the value of the "value" parameter
      Default:
      ""
    • pattern

      String pattern
      Returns the pattern used to locate an element.
      Returns:
      The pattern used to locate an element.
      Default:
      ""
    • ariaRole

      com.microsoft.playwright.options.AriaRole ariaRole
      Returns the AriaRole value specified in the LocateBy annotation. AriaRole is an enumeration that represents the ARIA roles defined in the W3C ARIA specification. It is used to locate an element based on its role attribute.
      Returns:
      The AriaRole value specified in the LocateBy annotation. If not specified, returns AriaRole.NONE.
      See Also:
      Default:
      NONE