差異處
這裏顯示兩個版本的差異處。
Both sides previous revision 前次修改 下次修改 | 前次修改 | ||
rf:rf:troubles:chrome:element_is_not_clickable [2018/01/28 21:20] tony [How to prevent the problem?] |
rf:rf:troubles:chrome:element_is_not_clickable [2023/06/25 09:48] (目前版本) |
||
---|---|---|---|
行 19: | 行 19: | ||
後來從[[https://sites.google.com/a/chromium.org/chromedriver/help/clicking-issues|此篇文章]]得知,ChromeDriver使用模擬方式去點element中間的位置;假如你所給予的位置是使用者點不到的位置,就有可能會發生這樣的問題。\\ | 後來從[[https://sites.google.com/a/chromium.org/chromedriver/help/clicking-issues|此篇文章]]得知,ChromeDriver使用模擬方式去點element中間的位置;假如你所給予的位置是使用者點不到的位置,就有可能會發生這樣的問題。\\ | ||
\\ | \\ | ||
- | 舉例來說,使用一個modal dialog會讓背景呈現蓋住的效果;對使用者來說,背景是無法點擊的。假如這時候透過ChromeDriver去點擊背景的element,就會發生無法點擊的問題。 | + | 舉例來說,使用一個modal dialog會讓背景呈現蓋住的效果;對使用者來說,背景是無法點擊的。假如這時候透過ChromeDriver去點擊背景的element,就會發生無法點擊的問題。\\ |
\\ | \\ | ||
+ | 以我的問題來說,將xpath改為圖片或button的xpath即可解決。\\ | ||
+ | \\ | ||
+ | 因此,Click Element的xpath最好是設定為使用者一定可以點擊的到的位置。 | ||
===== Reference ===== | ===== Reference ===== | ||
* [[https://github.com/seleniumhq/selenium-google-code-issue-archive/issues/2766|Chrome - Element is not clickable at point #2766]] | * [[https://github.com/seleniumhq/selenium-google-code-issue-archive/issues/2766|Chrome - Element is not clickable at point #2766]] |