On a webpage, we are having two links displayed with no other attribute than the link text. I want to make a page object class for a page.
Here the question is how I can specify the WebElement
object declaration in page object class which uniquely identified the second instance of the links displayed.
<html>
<a href="a.html">Link</a>
<a href="a.html">Link</a>
</html>
for the above (just an example to get the idea), I want to get WebElement
object for the second link using PageFactory.initElement(driver, this)
statement
@FindBy(how = How.LINK_TEXT, using = "Link")
public static WebElement link;
I think the above will identify the first object only.