Annotation Interface LabelHint


@Retention(RUNTIME) @Target(FIELD) public @interface LabelHint
Using this annotation, the value of toString() method of the injected object will be extended with the list of hints provided to the annotation.

Examples:

 public class Homepage {

      @FindBy(css = ".teaser img")
      @LabelHint("teaser")
      private FluentWebElement teaserImage;
      //toString(): By.cssSelector: .teaser img (first) [teaser] (Lazy Element)

      @FindBy(css = ".teaser img")
      @LabelHint({"img", "teaser"})
      private FluentWebElement teaserImage;
      //toString(): By.cssSelector: .teaser img (first) [img, teaser] (Lazy Element)

      @FindBy(css = ".teaser img")
      @Label
      @LabelHint({"img", "teaser"})
      private FluentWebElement teaserImage;
      //toString(): Homepage.teaserImage [img, teaser] (Lazy Element)

      @FindBy(css = ".teaser img")
      @Label("teaserimg")
      @LabelHint({"img", "teaser"})
      private FluentWebElement teaserImage;
      //toString(): teaserimg [img, teaser] (Lazy Element)
 }
 
A label hint can be added to a @Page annotated FluentWebElement or FluentList field.

This annotation is independent from the Label annotation. Each one can be used without the other.

Defining a label hint can also be done inline on an a FluentWebElement or FluentList by calling the withLabelHint() method on it.

See Also:
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    Array of label hints
  • Element Details

    • value

      String[] value
      Array of label hints
      Returns:
      array of label hints