我正在尝试单击页面顶部的按钮。我正在使用 CSS 选择器,当我在本地 Eclipse 中运行它时它工作得非常好。但是当我尝试在本地机器上的 Jenkins 服务器上运行它时它失败了,说元素不可点击。当我看到 Jenkins 测试失败的屏幕截图时,我看到标题与我想要单击的按钮重叠。我已经尝试了几乎所有使用 XPath、CSS、移动到元素、移动鼠标的方法。但是还是不能解决,求大神帮忙。
我想点击添加按钮
org.openqa.selenium.WebDriverException: Element is not clickable at point (775.25, 10.166671752929688). Other element would receive the click: <div class="globalHeader-UtilTop"></div>
Command duration or timeout: 69 milliseconds
Build info: version: '2.53.0', revision: '35ae25b1534ae328c771e0856c93e187490ca824', time: '2016-03-15 10:43:46'
System info: host', ip: '', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_80'
<div class="Componet-intels**strong text**-Container">
<div class="Componet-intels-Container-Header">
<div class="Componet-intels-Container-Content">
<div class="Componet-intels-Container-Content-Row">
<span class="Componet-intels-Item"> Item # </span>
<span class="Componet-intels-Text-Item">
<span class="Componet-intels-Lable-Quantity"> Qty: </span>
<span class="Componet-intels-Text-Quantity">
<span class="Componet-intels-Button">
**<input class="Componet-intelsButtonIcon" type="button" value="Add">**
</span>
</div>
原文由 Samantha 发布,翻译遵循 CC BY-SA 4.0 许可协议
它清楚地表明,在这种情况下,我们想要点击的元素被其他元素 div 隐藏,它会接收点击。
我认为这是 UI 的问题,标题不应该隐藏元素,但你可以尝试一些事情: