我正在尝试使用SeleniumRC测试我的GWT应用程序,并尝试使用CSS选择器匹配元素。
我想要计算以下HTML中启用按钮的数量。
如果一个按钮在具有 class="x-panel-btn-td "
的 <td>
下面,那么它是可用的,如果它在具有 class="x-panel-btn-td x-hide-offsets"
的 <td>
下面,则它被禁用。
因此,基本上,我要检索所有具有类 x-panel-btn-td
的 <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>