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)
Asked
Active
Viewed 50 times
0
-
See this https://stackoverflow.com/questions/18436102/selenium-findby-vs-driver-findelement – pburgr Dec 03 '18 at 13:34
-
thanks but that don't help me, how can I factorize all imput and search buttom from my app? – Joseph Dec 04 '18 at 08:00
1 Answers
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
}

shubham chawla
- 96
- 6
-
-
Create instance of that class in which web element is defined and call its public method. – shubham chawla Dec 03 '18 at 23:59
-