Selenium WebDriverWait but still “Element is not clickable at point”

时光总嘲笑我的痴心妄想 提交于 2019-12-06 13:01:10

问题


I have the following code (br is the webdriver and everything is imported fine).

The first 3 lines work fine but the link1.click() still gives me an error:

link = WebDriverWait(br, 30).until(EC.element_to_be_clickable((By.ID, "buttonNew Project")))
link.click()    
link1 = WebDriverWait(br, 30).until(EC.element_to_be_clickable((By.ID, "MP")))
link1.click()

And even though it should have waited until its clickable, I still get the the error:

WebDriverException: unknown error: Element is not clickable at point (543, 170). Other element would receive the click: <div id="screenBlocker" style="width: 1920px; height: 979px; display: block; background-position: 940px 420px;"></div>
  (Session info: chrome=49.0.2623.108)
  (Driver info: chromedriver=2.21.371459 (36d3d07f660ff2bc1bf28a75d1cdabed0983e7c4),platform=Windows NT 6.1 SP1 x86_64)(543, 170)

回答1:


Other element would receive the click: <div id="screenBlocker" st...

screenBlocker does sound like a, well, Screen Blocker. You have a popup/overlay on top of the page which you need to close, make invisible.

If there is no visible "close" button, just make it invisible this way:

blocker = driver.find_element_by_id("screenBlocker")
driver.execute_script("arguments[0].style = {display: 'none'};", blocker)


来源:https://stackoverflow.com/questions/36269530/selenium-webdriverwait-but-still-element-is-not-clickable-at-point

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!