Selenium IDE无法识别复选框

Selenium IDE无法识别复选框,selenium,checkbox,selenium-ide,Selenium,Checkbox,Selenium Ide,通过Firefox Selenium IDE录制,无法捕获复选框。我如何做到这一点,下面是复选框的属性 span class="userAgreement"> <input id="ctl_ctl_MainContent_MainContent_Agreement" name="ctl$ctl$MainContent$MainContent$Agreement" tabindex="39" type="checkbox"> <label for="ctl_ctl_Mai

通过Firefox Selenium IDE录制,无法捕获复选框。我如何做到这一点,下面是复选框的属性

span class="userAgreement">
<input id="ctl_ctl_MainContent_MainContent_Agreement" name="ctl$ctl$MainContent$MainContent$Agreement" 
tabindex="39" type="checkbox">
<label for="ctl_ctl_MainContent_MainContent_Agreement">
span class=“userAgreement”>

只需对输入元素使用click命令即可

<tr>
    <td>click</td>
    <td>id=ctl_ctl_MainContent_MainContent_Agreement</td>
    <td></td>
</tr>

点击
id=ctl\U ctl\U主内容\U主内容\U协议

使用下面的代码,选中复选框

document.getElementById("ctl_ctl_MainContent_MainContent_Agr‌​eement").checked = true;

您是在FF或Chrome中使用Selenium IDE录制的吗?Chrome是否有硒的IDE。您的问题需要更详细和清晰。您好,Naveen,这是FF中的Selenium IDE。当我录制并重新录制时,检查复选框的步骤失败。谢谢请使用下面的代码尝试使用“runScript”语句。var chk=document.getElementsByClassName('userAgreement');chk.click();我使用document.getElementsByClassName('userAgreement')执行了一个runscript命令;chk.click();命令成功通过,没有失败。但是检查不起作用。字段未被检查。是否必须单独使用“单击”命令?是。在第1行中,document.getElementsByCassName('userAgreement');在第2行chk.click()中;感谢Jsmith,但是如果我使用click Id,并且显示错误消息“element Id not found”,则复选框未选中