Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags


ElementNotVisible Exception in Selenium

Educative Answers Team

In Selenium, different methods can be used to reference an element. These include finding elements by username, id, xpath, etc.

However, if Selenium cannot find the element referenced, it returns the following error:

ElementNotVisibleException: Message: Element is not currently visible and so may not be interacted with
svg viewer


The following solutions can be tried to ensure that the problem is solved.

  1. This error may occur if selenium starts finding the element before the page is loaded. Sleep will not work since every device requires a different amount of time to load the webpage. The easiest way to resolve this is to use the following.
// Wait until an element with id password appears 
password  = WebDriverWait(driver, 3).until(EC.visibility_of_element_located((, "password")))
  1. Another reason could be that javascript embedded fake elements that can’t be detected by selenium. To solve this use the following.

This code will select the second object in an array of objects and click on it.

  1. Another solution could be finding the element immediately before the target element. Then, press the tab to move onto the next element.
//find the element preceding the target element
username = br.find_element_by_name("username")

// use tab to move to the next hidden element.

//now you can send your password
username.send_keys("your password")


Copyright ©2022 Educative, Inc. All rights reserved

View all Courses

Keep Exploring