1

I have a problem with Selenium WebDriver throwing ElementNotVisibleException for the element being loaded in a pop-up window even though when instantiating the WebDriver I use:

driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);

Occurs for Chromedriver and IEDriver

4
  • Is the popup javascript alert or some element inside the page? Commented Jan 15, 2013 at 8:52
  • it's an overlay on the page Commented Jan 15, 2013 at 8:55
  • It sometimes happens when the element is always on page, but its hidden by javascript. Then sometimes WebDriver thinks that its still hidden. Will have to investigate on it how do I solve it... Commented Jan 15, 2013 at 9:00
  • it seems that WebDriver ignores implicitlyWait - stack trace shows "command duration or timeout: 31 miliseconds" Commented Jan 15, 2013 at 9:15

1 Answer 1

3

Seems that solution was quite simple:

WebElement cBoxOverlay = wait.until(ExpectedConditions
            .visibilityOf(driver.findElement(By.id("cboxOverlay"))));

Driver waits to load the cBox and then tries to find the close button

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks, this is helpful. In case anyone else is wondering, you'll first need to do something like this, in order to call wait: WebDriverWait wait = new WebDriverWait(driver, 100);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.