我正在尝试使用 SeleniumRC 测试我的 GWT 应用程序,并尝试使用 CSS 选择器匹配元素。
我想计算以下 HTML 中启用按钮的数量。
如果按钮在 with 下,则启用该按钮,如果在<td>
with下,class="x-panel-btn-td "
则将其禁用。<td>
class="x-panel-btn-td x-hide-offsets"
所以基本上,我想<td>
用 class 检索所有 s下的按钮数x-panel-btn-td
。
<table cellspacing="0">
<tbody>
<tr>
<td id="ext-gen3504" class="x-panel-btn-td ">
<em unselectable="on">
<button id="ext-gen3506" class="x-btn-text" type="button">OK</button>
</em>
</td>
<td id="ext-gen3512" class="x-panel-btn-td x-hide-offsets">
<em unselectable="on">
<button id="ext-gen3506" class="x-btn-text" type="button">Yes</button>
</em>
</td>
<td id="ext-gen3520" class="x-panel-btn-td">
<em unselectable="on">
<button id="ext-gen3506" class="x-btn-text" type="button">No</button>
</em>
</td>
<td id="ext-gen3528" class="x-panel-btn-td x-hide-offsets">
<em unselectable="on">
<button id="ext-gen3506" class="x-btn-text" type="button">Cancel</button>
</em>
</td>
</tr>
</tbody>
</table>