python selenium is not clickable at point

Posted in :

常見的問題,是有圖層蓋到畫面上的可點選項目,所以在 selenium 裡使用 click() 會失敗,並顯示錯誤訊息:

Element is not clickable at point (X,Y)

解法1: 移到該可以區域,測試結果,沒有用,因為 click() 本來就會去捲動畫面到該物件。

driver.execute_script("arguments[0].scrollIntoView(false);", el_picker)

解法2: 測試可行。

driver.execute_script("arguments[0].click();", el_picker)

資料來源

Selenium-Debugging: Element is not clickable at point (X,Y)
https://stackoverflow.com/questions/37879010/selenium-debugging-element-is-not-clickable-at-point-x-y

How To Deal With “Element is not clickable at point” Exception Using Selenium
https://www.lambdatest.com/blog/how-to-deal-with-element-is-not-clickable-at-point-exception-using-selenium/

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *