Selenium Element not interactable – python


I wrote a simple application in python, but when trying to click a button, I get an error Element not interactable. Here is a part of the code where it happens. I did wait for the element to render.

WebDriverWait(driver, 60).until(EC.presence_of_element_located((By.XPATH, '//*[@id="root"]/div[2]/div/div/div[2]/ul/li/button')))
driver.find_element(By.XPATH, '//*[@id="root"]/div[2]/div/div/div[2]/ul/li/button').click()

The error happens on this website: when clicking Connect Wallet in the top right corner and then trying to click Phantom in the opening window.


Reason behind this exception:

element not interactabe” exception may occur due to various reason.

  1. Element is not visible
  2. Element is present in off screen (After scroll down it will display)
  3. Element is present behind any other element
  4. Element is disable

For your case it’s locator, you can use below locator to click on it.






(//button[contains(.,'Connect Wallet')])[1]

The Syntax should be like

element = WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "myXpath")));


from import By
from import WebDriverWait
from import expected_conditions as EC

I have tested with First and third XPATH, it’s working for me, let me know if this does not solve your issue.

Answered By – Akzy

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published