0
我試圖找到一個動態元素並選中該複選框。一旦複選框被選中,列表會自動收到值1。我試過xpath /css
,但沒有任何結果。無法通過webdriver查找動態元素
DOM:
<table class="bulk_task_table">
<tbody>
<tr class="table_row">
<td class="servicenamewrapper">
<td style="margin:0; padding:0; border:0; width:0;"></td>
<td style="margin:0; padding:0; border:0; width:0;"></td>
<td class="skill_name" width="160px">
<div id="c23743691548_ctl" style="display:inline;">
<div id="c23743691548" class="skillwrapper" style="background-color:#FFFFFF;">
<span id="c525_ctl">
<div class="renderWithName">
<div class="left">
<label for="c525">service</label>
</div>
<div class="right">
<input id="c525" class="skill48" name="c525" type="checkbox">
</div>
</div>
</span>
<span id="c526_ctl">
<select id="c526" class="listbox skill48" name="c526" size="1">
<option value="0">0</option>
<option value="1">1</option>
</select>
</span>
</div>
</div>
</td>
<tr class="table_row">
<td class="servicenamewrapper"> </td>
<td class="skill_name">
<td class="skill_name">
<td class="skill_name">
<div id="c529_ctl" style="display:inline;">
<div id="c529" class="globalswitchwrapper">
<span id="c530_ctl">
<div class="renderWithName">
<div class="left">
<label for="c530">Service</label>
</div>
<div class="right">
<input id="c530" class="skill48" name="c530" type="checkbox">
</div>
</div>
</span>
<span id="c531_ctl">
<select id="c531" class="listbox skill48" name="c531" size="1">
<option value="0">0</option>
<option value="1">1</option>
<option value="2">2</option>
OBS:因爲它可以在上面的代碼看來,有兩個列表稱爲「服務」具有相同的類名。
感謝@Mahipal提供的幫助,給定的xpath解決了我的錯誤。 – Mary
太棒了!別擔心。不用謝 :-) – Mahipal