...
In order to unit test a page, you'll need to create an instance of PageTester. It acts as both the browser and the servlet container so that you can use it to drive your page. As it
The PageTester falls into a middle ground between pure unit testing and full-scale integration testing.
As the PageTester is not a real servlet container, you need to tell it the same information as you would in web.xml:
...
To submit a form by clicking a submit button, call the clickSubmit() method instead.
Unit testing a component
...