मैं अपने जीडब्ल्यूटी ऐप का परीक्षण करने के लिए सेलेनियमआरसी का उपयोग करने की कोशिश कर रहा हूं और सीएसएस चयनकर्ताओं का उपयोग करके तत्वों से मिलान करने की कोशिश कर रहा हूं।मैं अपने सीएसएस चयनकर्ता से मेल खाने वाले तत्वों की संख्या कैसे गिन सकता हूं?
मैं निम्नलिखित 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>
FYI करें, नीचे स्क्रॉल कृपया मेरा उत्तर देखने के लिए आप देख रहे हैं Webdriver बराबर – gorbysbm