SeleniumRCを使用してGWTアプリをテストし、CSSセレクターを使用して要素を照合しようとしています。
次のHTMLで有効になっているボタンの数を数えたいです。
ボタンがwithの下にある場合は有効になり、<td>
withの下にあるclass="x-panel-btn-td "
場合は無効になり<td>
ますclass="x-panel-btn-td x-hide-offsets"
。
<td>
したがって、基本的に、クラスを持つすべての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>