@Retention(value=RUNTIME) @Target(value={FIELD,TYPE}) public @interface FindBy
PageFactory
this allows users to quickly and easily create PageObjects.
It can be used on a types as well, but will not be processed by default.
You can either use this annotation by specifying both "how" and "using" or by specifying one of
the location strategies (eg: "id") with an appropriate value to use. Both options will delegate
down to the matching By
methods in By class.
For example, these two annotations point to the same element:
@FindBy(id = "foobar") WebElement foobar;
@FindBy(how = How.ID, using = "foobar") WebElement foobar;
and these two annotations point to the same list of elements:
@FindBy(tagName = "a") List<WebElement> links;
@FindBy(how = How.TAG_NAME, using = "a") List<WebElement> links;
public abstract How how
public abstract String using
public abstract String id
public abstract String name
public abstract String className
public abstract String css
public abstract String tagName
public abstract String linkText
public abstract String partialLinkText
public abstract String xpath
Copyright © 2015. All rights reserved.