« Wrapped up the chapt... | Main | The discredited... »

Java web application testing tools.

I've been investigating web application testing tools, both for unit testing of web components such as Struts Actions and for functional testing. I read about JUnit extensions Cactus and HttpUnit in Hightower and Lesieki's book Java Tools for Extreme Programming. I learned about StrutsTestCase and JUnitDoclet from Matt Raible's gold-mine of example Ant code: the AppFuse project. That was enough to get me started.

I put together a simple test app with Cactus and StrutsTestCase and was pleased to find how easy it is to invoke Cactus from an Ant script and have Cactus start Jetty, run my tests within the Jetty, and shutdown Jetty when the tests complete. Cactus is going to make it really easy for us to unit test our Servlets, Filters, JSP pages, and Struts Actions. Cactus uses HttpUnit and HttpUnit makes it easy to make sense out of the responses that come back from the web layer, see the HttpUnit cookbook page for an example if this. I wish I had done this a long time ago, how did I live without this stuff!

So, I'm all set for unit testing. Now I need to figure out what to do for functional testing. HttpUnit, MaxQ, and Canoo look promising. I found the bewilderingly long list of functional testing tools at opensourcetesting.org. What open source or commercial tools have you used for functional testing of web applications?
Comments:

Gah... rather than spend this time figuring out how to test your stuff in the container (very very slow) try switching to a framework that lets you easily test outside the container (WebWork) and invest some time in learning Dynamic Mock Objects. You can test the interaction of your code with the container without having to test the container and start/stop your container. MUCH MUCH faster. It's the difference between developers testing code with every build vs. testing maybe once a day.

Posted by Jason Carreira on July 27, 2003 at 02:08 AM EDT #

The *cough* *cough* Microsoft WebApplication Stresstool.

Posted by Gerhard on July 27, 2003 at 09:26 AM EDT #

Jason, the cool thing about Cactus is that it launches and shuts down Jetty for you and it does it so fast that you barely notice it is happening. No matter what MVC framework you choose, you still need to test those presentation tier components like JSP pages, Servlets, and Filters. The Cactus and HttpUnit combo is a great way to do that.

Posted by Dave Johnson on July 27, 2003 at 11:20 AM EDT #

Dave, could you please put your sample test app available for download, like AppFuse? Thanks, Nikhil,

Posted by Nikhil on July 27, 2003 at 06:18 PM EDT #

I would like to post a sample app, but the one I have is a little too domain specific. I'll see what I can do.

Posted by Dave Johnson on July 28, 2003 at 11:18 AM EDT #

You might want to take a look at jWebUnit at http://jwebunit.sourceforge.net

Posted by Pascal Thivent on July 29, 2003 at 02:02 AM EDT #

I could sure use more TestCases for Roller right about now....

Posted by Lance on July 29, 2003 at 03:37 PM EDT #

Post a Comment:
  • HTML Syntax: NOT allowed

« Wrapped up the chapt... | Main | The discredited... »

Welcome

This is just one entry in the weblog Blogging Roller. You may want to visit the main page of the weblog

Related entries

Below are the most recent entries in the category Java, some may be related to this entry.