I want to wait for an element that appears on the page after the page reloads.
I have tried the below code:
fluentWait.until(ExpectedConditions.presenceOfElement(By.id("Id"));
Here is fluentWait:
FluentWait fluentWait = new FluentWait<>(webDriver) {
.withTimeout(30, TimeUnit.SECONDS)
.pollingEvery(200, TimeUnit.MILLISECONDS);
}
But this throws an exception such as: NoSuchElementException. How to solve this?