Package org.fluentlenium.core.annotation
Annotation Type LabelHint
-
@Retention(RUNTIME) @Target(FIELD) public @interface LabelHint
Using this annotation, the value oftoString()
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
annotatedFluentWebElement
orFluentList
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
orFluentList
by calling thewithLabelHint()
method on it.
-
-
Required Element Summary
Required Elements Modifier and Type Required Element Description java.lang.String[]
value
Array of label hints
-