0

I try to refectoring a WebElement buttom with annotation (@FindBy). It's same id in different PageOject. How can I factoring this WebElement ? (eg. validate, search button, name, birthday input)

Al Imran
  • 882
  • 7
  • 29
Joseph
  • 1

1 Answers1

1

You can use @FindBy annotations and make web element private and declare a method to access that private web element.

@FindBy(how=How.XPATH,using="your x path of element")
private WebElement elementName;

public WebElement elementName(){
     return elementName
    }