I have a link that I press and then it runs some JS and a new link is generated on the page which has the text "View report"
How can I wait on the page until this link is present and clickable, or timeout if its not displayed in say five minutes?
I have seen this question asked a few times and tried some of the solutions but can't get any to work.
I've even tried a rubbish way of just waiting for a minute but sometimes the link takes longer to appear so it fails.
1 Answer
Try this
WebDriverWait wait = new WebDriverWait(driver, 60);// 1 minute
wait.until(ExpectedConditions.visibilityOfElementLocated(By.linkText("View report")));