Debugging “Element is not clickable at point” error

后端 未结 30 2116
余生分开走
余生分开走 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条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-22 00:28

    I was facing the same problem with clj-webdriver (clojure port of Selenium). I just translated the previous solution to clojure for convenience. You can call this function before doing click or whatever to avoid that problem.

    (defn scrollTo
      "Scrolls to the position of the given css selector if found"
      [q]
      (if (exists? q) 
        (let [ loc (location-once-visible q) jscript (str "window.scrollTo(" (:x loc) "," (:y loc) ")") ] 
          (execute-script jscript))))
    

提交回复
热议问题