I have an xpath where text may have multiple options, about 8-10.
//name[contains(text(),'abc')]"
//name[contains(text(),'xyz')]"
Conventionally I am using xpath like this:
driver.findElement(By.xpath("//text[contains(text(),'"+variable+ "')]")).click();
Is there a way I can achieve this in Page Factory?
In page factory, we have @FindBy
annotation, which take inputs like this:
@FindBy(xpath="//div[contains(text(), 'static text')]").
I am just trying to figure out how to make this dynamic.
Please let me know how can I find this using page factory.