You can also use it with Page Object Pattern, e.g: @FindBy(xpath = "//*[contains(text(), 'Best Choice')]") WebElement buttonBestChoice;