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;
Use the position() function with the or operator:
@FindBy(xpath = "(//label[@class='x-form-item-label'])[position()=19 or position()=36]")
public WebElement lblFee;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With