tclwebtest

Sourceforge Home  ·  Download  ·  Documentation  ·  Other similar projects  ·  Home (this page)
tclwebtest is a tool to write automated tests for web applications. It provides a simple API for issuing http requests, dealing with the result and assume specific response values, while taking care of the details such as redirects and cookies.

It has some basic html parsing functionality, to provide access to elements of the result html page that are needed for testing (mainly links and forms).

A typical test script looks like this:
set SERVER "testserver"
do_request "http://$SERVER/sometesturl/"
assert text "some text"

link follow "login"

field fill "testuser"
field fill "testpassword"
form submit

assert text "you are logged in as testuser"
    
This script can be saved in a file, e.g. login.test, and executed with ./tclwebtest login.test. The script itself is tcl, so you can do powerful things with only a few commands.

tclwebtest tries to minimize the effort to write tests by implicitely assuming specific conditions whenever it makes sense. For example it always expects the server to return http codes other than 404 or 500, unless otherwise specified.

The assertion procedures are targeted at test writers who want to make sure the behaviour of their web applications stays the same, without caring for style or minor wording changes. In the example above, it is just assumed that there is a link with the text "login" on the first page, that clicking on it results in a page with at least one form with at least two text-entry fields on it, and that submitting the form with the specified values results in a page that contains the "logged in" text.

tclwebtest should be suitable for testing larger chains of user interaction on a web application, for example a full ecommerce ordering session. tclwebtest could visit an ecommerce site as anonymous user, add some products to its shopping cart, check out the cart, register itself as user and enter a test address etc. The test script could also include the administration part of the interaction, by explicitely logging in as site admin, reviewing and processing the order, nuking the test user etc.

What's missing

Remarks, suggestions and help is highly welcome.
SourceForge Logo
Tilmann Singer
Last modified: Mon May 26 20:46:56 CEST 2003