PageFactory是为了支持页面设计模式而开发出来的,把元素定位分离出来
Web端
@FindBy(id = "foobar")
WebElement foobar;
移动端
@AndroidFindBy(xpath = "//android.widget.Button[@content-desc=\"Add Contact\"]")
private MobileElement BtnAddContact
它提供的方法都是静态的,可以直接调用
initElements(ElementLocatorFactory factory,java.lang.Object page)