【问题标题】:How to click element with overflow:hidden in cucumber / capybara如何单击溢出的元素:隐藏在黄瓜/水豚中
【发布时间】:2016-02-18 21:23:46
【问题描述】:

我正在尝试测试智能 GWT 应用程序。我有一个严重的问题。我不能点击元素使用:

find(:xpath, "/html/body/div[10]/div[3]/div/div/div[1]/div/form/table/tbody[2]/tr[4]/td/table/tbody/tr/td[2]/span/img").click

它的回报

无法找到 xpath "/html/body/div[10]/div[3]/div/div/div[1]/div/form/table/tbody[2]/tr[4]/td/table/tbody/tr/td [2]/跨度/img" (Capybara::ElementNotFound)

代码如下:

<td id="isc_UV" class="comboBoxItemPickerCell" style="font-size:22px;">
<span id="isc_UW" handlenativeevents="false" $9a="picker" $89="isc_SelectItem_17" tabindex="-1" style="margin-left:0px;-moz-user-focus:ignore;cursor:pointer" role="button">
<img id="isc_UX" class="comboBoxItemPicker" align="TEXTTOP" width="18" height="22" border="0" draggable="true" suppress="TRUE" style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; display: block;" src="a.gif">
</span>
</td>

这个img上有很多div标签,溢出:隐藏。如何点击这些元素?

【问题讨论】:

  • 你可以试试 find(:css, '#isc_UX').click

标签: testing selenium-webdriver cucumber capybara smartgwt


【解决方案1】:

尝试将visible: false 选项传递给find 方法调用

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-03-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-07-06
    • 2012-01-18
    相关资源
    最近更新 更多