/**
* <p>Submit incorrect input fields and verify the correct response.</p>
*/
public void testIncorrect() throws Exception {
HtmlSpan span = null;
HtmlTextInput username = (HtmlTextInput) element("form:username");
HtmlPasswordInput password = (HtmlPasswordInput)
element("form:password");
HtmlSubmitInput submit = (HtmlSubmitInput) element("form:submit");
username.setValueAttribute("bb");
password.setValueAttribute("");
submit(submit);
assertEquals("logon", title());
span = (HtmlSpan) element("globalErrors");
assertNotNull(span);
assertEquals("[EH][EP] can not be less than 3 characters.[ES]" +
"[EP] is required.[ES][EF]",
span.asText());
username = (HtmlTextInput) element("form:username");
assertNotNull(username);
assertEquals("bb", username.getValueAttribute());
span = (HtmlSpan) element("form:usernameErrors");
assertNotNull(span);
// FIXME: response string should really include "Username:"
assertEquals("[EH][EP] can not be less than 3 characters.[ES][EF]",
span.asText());
password = (HtmlPasswordInput) element("form:password");
assertNotNull(password);
assertEquals("", password.getValueAttribute());
span = (HtmlSpan) element("form:passwordErrors");
assertNotNull(span);
// FIXME: response string should really include "Password:"
assertEquals("[EH][EP] is required.[ES][EF]", span.asText());
}