1
我正在使用HtmlUnit设置页面中的复选框。对于复选框HTML代码:htmlunit:未勾选复选框
<input id="Checkbox" type="checkbox" name="Checkbox" style="color:Black;"/>
我的Java代码来设置复选框:
HtmlCheckBoxInput checkBox = page.getHtmlElementById("Checkbox");
checkBox.setChecked(true);
FileUtils.writeStringToFile(new File("src/test/page-dumps/page-3.html"),page.asXml(),"UTF-8");
当我在浏览打开page-3.html
,ckeckbox是听之任之。为什么不检查?