我正在尝试将我的旧 watir 脚本转换为使用 watir-webdriver,因为这将(最终)支持 IE9 和 Firefox 4。$browser.table_row(:id => "account_1").click
我曾经在 watir/firewatir 中单击屏幕上表格的第一行,但是对此的 API 在 watir-webdriver 中进行了修改。现在,代码是这样的:$browser.table(:class => "sortable")[0].click
它应该抓取表格的第一行,然后单击它。它似乎是成功的,因为它继续执行代码,但实际上并没有单击该行。
有人可以解释在这种情况下正确的语法是什么吗?
这是我要单击的区域周围的源代码:
<table class="sortable">
<thead>
<tr id="">
<th> </th>
<th class="sort" > Name </th>
<th class="sort" > Number </th>
</tr>
</thead>
<tbody>
<tr id="account_1" onclick=";$('timer').show();; new Ajax.Request('create_new_account', {asynchronous:false, evalScripts:true, onComplete:function(request){;$('timer').hide();initializeCustomEffects();}})">
<td></td>
<td class="sortTd">Test Account</td>
<td class="sortTd">1</td>
</tr>
</tbody>