From the course: Test Automation with Selenium WebDriver for Java

Unlock this course with a free trial

Join today to access over 24,800 courses taught by industry experts.

Solution: Detect visibility

Solution: Detect visibility

(upbeat music) - Since WebDriver works with the DOM, it's still able to locate elements that are not visible on the page, so I was able to find the hidden element by its ID. Next, I used an if clause to check if the element is visible by calling the isDisplayed method, and if it's not, I print a message stating such.

Contents