【发布时间】:2016-12-19 18:52:03
【问题描述】:
我正在尝试单击页面顶部的按钮。我正在使用 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>
【问题讨论】:
-
没有一些 html 预览/硒代码很难提供帮助
-
@Dekel 更新了帖子。感谢您的建议。
-
对于
<input>元素,我使用.submit()而不是.click()方法解决了类似的问题。
标签: java css selenium jenkins cucumber