17 Feb 2007 wainstead   » (Master)

I finally registered with Sourceforge for a new project: lhhreplay. This is a Perl script I started developing a couple years ago to replay the output of LiveHTTPHeaders.

I'd searched high and low for a good testing solution for web applications; I should have written an article at the time. I tried Selenium, HTTP::Recorder, and a few others but one key obstacle was being able to go from HTTP to HTTPS and back again.

So I worked out a small Perl script that uses the saved output of a LiveHTTPHeaders session, and installed Test::WWW::Mechanize. This little tool has been such a huge timesaver for me that I feel the need to release it.

One of my typical uses is to open LiveHTTPHeaders, fill up the shopping cart I'm working on with a lot of items, and then save the script. Whenever I've emptied the cart I can run:

lhhreplay.pl fillcart.lhh

where fillcart.lhh is the LiveHTTPHeaders output that I saved to disk. Some of the items that go in the cart are complex, like Christmas cards that require sandwiching images and adding text; I'm spared the drudgery of doing this sort of thing over and over.

There are a few caveats I'm going to have to solve however. It's almost always a good idea to delete your cookies before you start; to log out of the web app before you start; and the set of rules that I use for Test::WWW::Mechanize are specific to my needs, so that will have to be factored out somehow. But these issues can be solved.

Inevitably I will have to factor the code out of the script in to a Perl module. And one longstanding "bug" is how the script handles 302s, but that would take up too much space here to go into.

For now I am waiting for Sourceforge to approve my project request. An example run is here. When there's failures the Test harness system reports the number of failures at the end of the run.

Latest blog entries     Older blog entries

New Advogato Features

FOAF updates: Trust rankings are now exported, making the data available to other users and websites. An external FOAF URI has been added, allowing users to link to an additional FOAF file.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!