Python selenium: wait until element is clickable - not working Python selenium: wait until element is clickable - not working selenium selenium

Python selenium: wait until element is clickable - not working


Correct syntax for explicit wait in python is :

 element = WebDriverWait(driver, 20).until( EC.presence_of_element_located((By.ID, "myElement")))

Better that After above you do : element.click();

So in your case :

from selenium.webdriver.common.by import Byfrom selenium.webdriver.support.ui import WebDriverWaitfrom selenium.webdriver.support import expected_conditions as ECelement = WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "myXpath")))element.click();

Better you follow it. Also share your whole code so I can correct it. Your just 1 line code doing little confuse.


I had also that problem... Web apps have views over views and Appium sometimes gets wrong.

This worked for me:

x = webElement.location['x'] + (webElement.size['width']/2)y = webElement.location['y'] + (webElement.size['height']/2)print("x: "+x+" - y: "+y)//I have setted a 200 milli duration for the click...//I use tap just for Android... If is iOS for me it works better touchActiondriver.tap([(x,y)], 200)

Edit:

I misunderstood your question... Sorry...Maybe modifying your Xpath to:(don't know if this will work at a web app)

xpath = "//whatever_goes_here[@clickable='true']"