Reputation: 51
I've come up against a weird problem! I am a noobie Selenium Framework user, but anyway I use:
wait.until(ExpectedConditions.invisibilityOfElementLocated(xpath)).
This construction works in debug mode only, however, when I run test without debug, it seems like Compiler doesn't check this line.
Upvotes: 0
Views: 2529
Reputation: 50809
It's a timing issue, the form might be considered invisible to the driver but the button is not loaded yet. In addition (or instead) to waiting for the form to disappear you should wait for the button to be visible and clickable
WebElement button = wait.until(ExpectedConditions.ElementToBeClickable(xpath));
button.click();
Upvotes: 1