I want to reload the page on each iteration of Awaitility.await()
to check if the text of the element is changed.
My code:
Awaitility.await()
.pollInterval(5000, TimeUnit.MILLISECONDS)
.atMost(30, SECONDS)
.until(() -> driver.findElement(By.id("id")).getText(), equalTo(EXPECTED_TEXT));
}
And I want to reload page on each .pollInterval
, every 5 sec, with:
driver.navigate().refresh()
How can I achieve this? Or suggest a better solution with java. Thanks!