My codes where I use WebDriverWait doesn't seem to actually wait. For example
element = WebDriverWait(driver, 30).until(
EC.element_to_be_clickable((By.XPATH,"//*[@id='active-grid']/table/thead/tr/th[2]/a[1]"))
)
element.click()
clicks before the element is actually clickable and I get element is not clickable at point (74, 297). Other element would receive the click error. It would work if I use time.sleep() and force it to wait a certain amount of seconds for the page to fully load. Problem is the website I need to run this on is super unstable and it would sometime take a second sometimes 30 seconds for each action to load I can't just wait 30 seconds for each step. How do I fix this? What's wrong with the way I'm using webdriverwait? Thank You!
I thought maybe it has something to do with some other element hasn't finished loading and gets in the way? How do I check that? there's a element_to_be_invisible but I don't know how to figure out which element needs to be invisible. Thanks!
Edit: Thanks, it looks like loading screen is blocking it like you guys said I added WebDriverWait(driver,30).until( EC.invisibility_of_element((By.XPATH,"//*[@class='k-loading-image']"))) and it's now working as expected!
WebDriverWaitcorrectly. The element you are waiting for IS clickable... it's just blocked by another element but Selenium doesn't know that until you actually attempt the click.