HtmlUnitTestPage htmlUnitPage = new HtmlUnitTestPage(cr);
assertTrue(htmlUnitPage.getWebClient().isJavaScriptEnabled());
HtmlHiddenInput hiddenSchemaValueField = null;
hiddenSchemaValueField = htmlUnitPage.getHtmlForm().getInputByName("schemavalue");
assertEquals("[\"dn\",\"employeenumber\",\"employeestatus\"]",
hiddenSchemaValueField.getValueAttribute());
// de-select employeestatus checkbox and verify results
HtmlCheckBoxInput chkFieldBefore = htmlUnitPage.getHtmlForm().getInputByValue("employeestatus");
assertTrue(chkFieldBefore.isChecked());
HtmlPage page2 = chkFieldBefore.click();
HtmlCheckBoxInput chkFieldAfter = htmlUnitPage.getHtmlForm().getInputByValue("employeestatus");
hiddenSchemaValueField = htmlUnitPage.getHtmlForm().getInputByName("schemavalue");
assertFalse(chkFieldAfter.isChecked());
assertEquals("[\"dn\",\"employeenumber\"]", hiddenSchemaValueField.getValueAttribute());
// de-select employeenumber checkbox and verify results
chkFieldBefore = htmlUnitPage.getHtmlForm().getInputByValue("employeenumber");
assertTrue(chkFieldBefore.isChecked());
HtmlPage page3 = chkFieldBefore.click();
chkFieldAfter = htmlUnitPage.getHtmlForm().getInputByValue("employeenumber");
hiddenSchemaValueField = htmlUnitPage.getHtmlForm().getInputByName("schemavalue");
assertFalse(chkFieldAfter.isChecked());
assertEquals("[\"dn\"]", hiddenSchemaValueField.getValueAttribute());
htmlUnitPage.getWebClient().closeAllWindows();
}