Senhores, poderiam explicar-me qual as vantagens e desvantagens de se usar os objetos By ou usar o pattern PageFactory?
@FindBy(how = How.XPATH, using = "\\a[@class = 'ng-bindign']")
private WebElement myButton;
ou
private By myButtonBy = By.xpath( "\\a[@class = 'ng-bindign']");
private WebElement myButton;
//...
public static void main(String args[]){
//this first line will be supressed if we use @FindBy
myButton = driver.findElement(myButtonBy);
my Button.click();
}