【发布时间】:2016-05-11 11:01:58
【问题描述】:
我想使用 CodedUI 在 html 表单上选择(检查)多个复选框,如下所示一些想法谢谢:
UITestControl checkBoxes = new UITestControl(browser);
checkBoxes.TechnologyName = "Web";
checkBoxes.SearchProperties.Add("TagName", "TD");
checkBoxes.SearchProperties.Add("ControlType", "Cell");
checkBoxes.SearchProperties.Add("Name", "checkboxes[]");
// checkBoxes.SearchProperties[HtmlCheckBox.PropertyNames.Value] = "cb2";
// checkBoxes.SearchProperties.Add("InnerText", "Checkbox Items:");
checkBoxes.SetProperty("Checked", true);
<tr>
<td>
Checkbox Items:<br />
<input type="checkbox" name="checkboxes[]" value=
"cb1" />Checkbox 1
<input type="checkbox" name="checkboxes[]"
value="cb2" />Checkbox 2
<input type="checkbox" name=
"checkboxes[]" value="cb3" checked="checked" />Checkbox 3
</td>
</tr>
【问题讨论】: