Java – Wait.until() with Webdriver PageFactory elements

javaselenium-webdriverwebdriver

i'm using @FindBy annotations to locate elements on my page. Like this:

   @FindBy(xpath = "//textarea")
    public InputBox authorField;

Please, help. I want use wait (ExpectedConditions) with my annotated elements. Like this:

wait.until(visibilityOfElementLocated(authorField));

instead of:

wait.until(visibilityOfElementLocated(By.xpath("//textarea")));

Thanks for advance

Best Solution

ExpectedConditions.visibilityOf(authorField);

Look at the source code of any Expected condition. It's very easy to write your own condition that can do everything you want.

Related Question