// Set the field parameter
container.setParameter("myfield", "one");
// Process page
FormPage formPage = (FormPage) container.testPage(FormPage.class);
System.out.println("\nFirst run finished");
System.out.println(
"======================== HTML Document ========================\n"
+ container.getHtml()
+ "\n===============================================================\n");
// Assert that form with id="form" was rendered
Assert.assertTrue(container.getHtml().indexOf("id=\"form\"") > 0);
// Assert that form field "myfield" was bound to request parameter "myfield"
Assert.assertEquals("one", formPage.getForm().getFieldValue("myfield"));
} catch (Exception exception) {
exception.printStackTrace(System.err);
Assert.fail();
}