请查看以下代码:
id= idConfirmedCheckbox
的XPath是什么?
<td class="tdCenter">
<input id="idConfirmedCheckbox" type="checkbox" onclick="return idConfirmedClicked(this);" name="idConfirmedCheckbox"/>
<input id="Customer_Person_Identifications_Identification_0_Confirmed" type="hidden" value="N" name="Customer_Person_Identifications_Identification_0_Confirmed"/>
<input id="Customer_Person_Identifications_Identification_0_NotConfirmedDisabled" type="hidden" value="" name="Customer_Person_Identifications_Identification_0_NotConfirmedDisabled"/>
</td>
<td class="tdCenter">
<input id="idConfirmedCheckbox" type="checkbox" onclick="return idConfirmedClicked(this);" name="idConfirmedCheckbox"/>
<input id="Customer_Person_Identifications_Identification_1_Confirmed" type="hidden" value="N" name="Customer_Person_Identifications_Identification_1_Confirmed"/>
<input id="Customer_Person_Identifications_Identification_1_NotConfirmedDisabled" type="hidden" value="" name="Customer_Person_Identifications_Identification_1_NotConfirmedDisabled"/>
</td>
答案 0 :(得分:0)
尝试以下Xpath:
//input[@id='idConfirmedCheckbox']
OR
//input[@id='idConfirmedCheckbox' and @type='checkbox']
OR
(//input[@id='idConfirmedCheckbox' and @type='checkbox'])[1]
根据需要将数组更改为1到2或3