【发布时间】:2014-07-07 16:48:02
【问题描述】:
请在下面找到代码:
<table class="cctable" width="100%" border="0" cellspacing="0" cellpadding="2" tabindex="0" summary="Content">
<thead id="Header">
<tbody>
<tr style="height:1px">
<tr style="height:1px">
<tr style="height:1px">
<tr style="height:1px">
<tr style="height:1px">
<tr style="height:1px">
<tr style="height:1px">
<tr style="height:1px">
<td class="tableText" nowrap="" height="10">
<td width="1" height="15">
<td class="tableText" nowrap="" height="10">
<td width="1" height="15">
<td class="tableText" width="100%" height="10" wrap="true" style="background-color: transparent;">
<a href="/tarf/servlet/dispatch?b_action=xts.run&m=portal/cc.xts&m_folder=iED96C06121E44804B62901EB41BCAEC2">**Hyper-V**</a>
</td>
<td width="1" height="15">
<td class="tableText" width="200" nowrap="" height="10">
<td width="1" height="15">
<td class="tableText" width="170" nowrap="" height="10">
</tr>
<tr style="height:1px">
<tr style="height:1px">
<tr style="height:1px">
<tr style="height:1px">
<tr>
</tbody>
<tfoot></tfoot>
</table>
我正在尝试点击用户界面上的“Hyper-V”链接。
我尝试了 css、xpath、name、id,所有可能的定位器,当我尝试通过 selenium IDE 2.5.0 找到它时,所有定位器都可以工作。当我评估时,元素会闪烁。
但是,当我在我的 webdriver 脚本中放置相同的定位器并尝试定位它时,它每次都会抛出“NoSuchElementException”。有人可以建议我如何处理吗? 如何知道 Selelnium 是否支持在我们的 UI 上定位元素,或者我们是否有任何限制。
让我知道你的建议/想法。
提前致谢。
【问题讨论】: