Logo
 

What is PageUnit?

PageUnit is an open source project dedicated to making an easy-to-use yet powerful tool for testing web applications.

PageUnit aims to be a part of the xUnit testing family, of which the best-known member is the JUnit testing framework. However, at this level we are not really doing unit testing, but functional testing (see Evil Unit Testing).

Update: PageUnit was written "long, long ago, in a technology far, far away". Today, I mainly use a unix/linux shell script that calls `curl` and pipes the results to a `grep` program. You can find this replacement tool at https://github.com/IanDarwin/scripts/blob/main/webtests, part of my https://github.com/IanDarwin/scripts/ large collection of free, open-soruce shell scripts.

There are many kinds of tests you can do against a web site, including:

  • HTML/XHTML testing - we don't do this. Try the W3C Validator.
  • Spell checking - we don't even think about that. But you should, if you run a web site.
  • Checking that pages load - we do that.
  • Making sure the correct page loads - we do that.
  • Checking for patterns on the page (using regular expression matching) - we do that.
  • Link checking - in a fit of insanity, we sort of do that too.

Quick Start

Download the jar files. Save them in a directory along with this sample test. Run java pageunit.PageUnit test1.txt. Sit back and watch the results.