Debugging “Element is not clickable at point” error

后端 未结 30 2143
余生分开走
余生分开走 2020-11-21 23:55

I see this only in Chrome.

The full error message reads:

\"org.openqa.selenium.WebDriverException: Element is not clickable at point (411, 675

30条回答
  •  -上瘾入骨i
    2020-11-22 00:15

    Apparently this is the result of a "Won't Fix" bug in the Chrome driver binary.

    One solution that worked for me (Our Mileage May Vary) can be found in this Google Group discussion, Comment #3:

    https://groups.google.com/forum/?fromgroups=#!topic/selenium-developer-activity/DsZ5wFN52tc

    The relevant portion is right here:

    I've since worked around the issue by navigating directly to the href of the parent anchor of the span.

    driver.Navigate().GoToUrl(driver.FindElement(By.Id(embeddedSpanIdToClick)).FindElement(By.XPath("..")).GetAttribute("href"));

    In my case, I'm using Python, so once I got the desired element, I simply used

    driver.get(ViewElm.get_attribute('href'))
    

    I would expect this to only work, however, if the element you are trying to click on is a link...

提交回复
热议问题