Next: Manual testing
Up: Test categories
Previous: Dbunit testing
Because our application is web-based, the natural way to test it's behaviour is to
emulate browser. There are two interesting test suits, that we decide to use - HttpUnit and
HtmlUnit.
HttpUnit emulates the relevant portions of browser behavior, including form submission, JavaScript,
basic http authentication, cookies and automatic page redirection, and allows Java test code to
examine returned pages either as text, an XML DOM, or containers of forms, tables, and links.
When combined with a framework such as JUnit,
it is fairly easy to write tests that very quickly verify the functioning of a web site.
HtmlUnit is a java unit testing framework for testing web based applications.
It is similar in concept to httpunit but is very different in implementation.
HttpUnit models the http protocol so you deal with request and response objects.
HtmlUnit on the other hand, models the returned document so that you deal with pages and forms and tables.
We will implement some tests using HtmlUnit and some using HttpUnit because different approach in
implementation of the two may make a difference in test results.
Next: Manual testing
Up: Test categories
Previous: Dbunit testing
Wiktor Kolodziej
2006-01-12