Java Tutorial - Java Script :
jUnit with HttpUnit
JUnit can be configured to perform a number of Web-based functional-testing tasks by using the HttpUnit add-in module. HttpUnit, available at http://httpunit.sourceforge.net/, is a free open source API for accessing Web sites without a browser. HttpUnit provides methods for sending HTTP requests, and processing and analyzing the responses. HttpUnit handles cookies, browser redirects, HTTPS, and many of the features needed to writes tests for Web applications. Utilities are also provided that can be used to compare a Web response against the expected result. HttpUnit is designed to work within the JUnit framework and can be used to build a comprehensive functionaltesting tool for Web applications.
HttpUnit combined with JUnit is a very powerful testing tool, but creating tests for Web applications this way requires a great deal of effort. Essentially,you must create a test program for each element of a Web application that will be tested. This adds time and expense to a project. HttpUnit and JUnit represent one approach for functional testing of Web sites. Another approach is offered by jMeter.
