差異處

這裏顯示兩個版本的差異處。

連向這個比對檢視

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]
行 1: 行 1:
-{{tag>​selenium RobotFramework}} 
-====== Element is not clickable issue on chrome ====== 
-===== Problem ===== 
-這陣子將SeleniumLibrary升級至3.0之後,在Firefox上測試遇到難以解決的問題,也因此將測試瀏覽器改為Chrome;然而移到chrome之後,原先可以在firefox上執行的測試,反而變得無法執行。其中一樣就是出現Element is not clickable的問題。 
-===== How to resolve? ===== 
-我要點擊的位置是Refresh的button:​\\ 
-{{:​rf:​rf:​troubles:​chrome:​rf_unclick_img.png|}}\\ 
-而我一開始使用的xpath是 
-<​code>​ 
-//​span[text()='​Refresh'​] 
-</​code>​ 
-{{:​rf:​rf:​troubles:​chrome:​rf_unclick_problem_xpath.png|}}\\ 
-但卻出現了以下錯誤訊息:​ 
-<code html> 
-WebDriverException:​ Message: unknown error: Element <span class="​ui-button-text">​...</​span>​ is not clickable at point (805, 96). Other element would receive the click: <span class="​ui-button-icon-primary ui-icon ui-icon-refresh"></​span>​ 
-  (Session info: chrome=63.0.3239.132) 
-  (Driver info: chromedriver=2.34.522940 (1a76f96f66e3ca7b8e57d503b4dd3bccfba87af1),​platform=Windows NT 6.3.9600 x86_64) 
-</​code>​ 
-後來從[[https://​sites.google.com/​a/​chromium.org/​chromedriver/​help/​clicking-issues|此篇文章]]得知,ChromeDriver使用模擬方式去點element中間的位置;假如你所給予的位置是使用者點不到的位置,就有可能會發生這樣的問題。\\ 
-\\ 
-舉例來說,使用一個modal dialog會讓背景呈現蓋住的效果;對使用者來說,背景是無法點擊的。假如這時候透過ChromeDriver去點擊背景的element,就會發生無法點擊的問題。 
-\\ 
  
-===== Reference ===== 
-  * [[https://​github.com/​seleniumhq/​selenium-google-code-issue-archive/​issues/​2766|Chrome - Element is not clickable at point #2766]] 
-  * [[https://​sites.google.com/​a/​chromium.org/​chromedriver/​help/​clicking-issues|Clicking issues of ChromeDriver]] 
- 
-=====    ===== 
----- 
-\\ 
-~~DISQUS~~