Reputation: 31
For the following scenario, xpath OR operator is not working. The same label showing in different nodes in different pages.
@FindBy(xpath = "(//label[@class='x-form-item-label'])[19] | (//label[@class='x-form-item-label'])[36]")
public WebElement lblFee;
Upvotes: 3
Views: 404
Reputation: 42518
Use the position()
function with the or
operator:
@FindBy(xpath = "(//label[@class='x-form-item-label'])[position()=19 or position()=36]")
public WebElement lblFee;
Upvotes: 2