【发布时间】: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