Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wait.until() with Webdriver PageFactory elements

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

like image 406
Arthur Avatar asked Dec 09 '22 01:12

Arthur


1 Answers

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.

like image 89
Pazonec Avatar answered Dec 22 '22 02:12

Pazonec