How to check if an element is visible in Selenium

You can use the isDisplayed() method of an element to find out if is displayed, but it may still be invisible if it’s obscured by another element.

Java

boolean isDisplayed = driver.findElement(By.id("myId")).isDisplayed();

Python

is_displayed = driver.find_element_by_id("myId").is_displayed()

C#

bool isDisplayed = driver.FindElement(By.Id("myId")).Displayed;