WebDriverException:元素不可单击 [英] WebDriverException: Element is not clickable at point
问题描述
完全错误
org.openqa.selenium.WebDriverException:无法在以下位置单击元素 点(931,23).其他元素将获得点击:
org.openqa.selenium.WebDriverException: Element is not clickable at point (931, 23). Other element would receive the click:
在无头浏览器中使用Jenkins运行硒测试 在以下环境中
Running selenium tests using Jenkins in headless browser In following environment
OS- CentOS 6和Xvfb安装在同一台计算机上
OS- CentOS 6 and Xvfb installed in same machine
Xvfb屏幕分辨率-Xvfb:1 -screen 0 1280x1024x16&
Xvfb screen resolution - Xvfb :1 -screen 0 1280x1024x16 &
驱动程序-Firefox驱动程序
Driver - Firefox driver
Selenium Webdriver版本-2.52.0
Selenium webdriver version - 2.52.0
同一测试用例在使用Firefox的Windows操作系统中可以正常工作
The same test case working fine in windows os with firefox
推荐答案
这是在不同的浏览器和不同的平台上进行测试很重要的原因.有时,在一个浏览器/操作系统上运行的内容不能在同一浏览器上,而是在不同平台上运行.
This is the reason it is important to test on different browsers and on different platforms. Sometimes what works on one browser/os does not work on the same browser but a different platform.
我会更新您的设置,以便在遇到此类错误(以及其他大多数错误)时制作一个屏幕截图.以我的经验,这是减少调试这些问题所花费时间的唯一最好的方法.
I would update your setup so that you make a screenshot when you run into this type (and most other types) of error. In my experience this is the single best thing you can do to reduce the time spent to debug these issues.
在我的设置中,我执行以下操作:
In my setup I do the following:
- 创建屏幕截图
- 从Selenium错误消息中捕获坐标
- 使用图像处理程序在点击发生的地方自动创建一个红点
通常,我只需要看一眼这样的图像就可以准确地了解正在发生的事情.
Usually I just have to take one look at such an image to see exactly what is happening.
这篇关于WebDriverException:元素不可单击的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!