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
The following solutions can be tried to ensure that the problem is solved.
// Wait until an element with id password appears
password = WebDriverWait(driver, 3).until(EC.visibility_of_element_located((By.id, "password")))
fake
elements that can’t be detected by selenium. To solve this use the following.driver.execute_script("document.querySelectorAll('label.boxed')[2].click()")
This code will select the second object in an array of objects and click on it.
//find the element preceding the target element
username = br.find_element_by_name("username")
// use tab to move to the next hidden element.
username.send_keys(Keys.TAB)
//now you can send your password
username.send_keys("your password")
Free Resources