ROBOWEB TEST SUITE GENERATOR VERSION 1.0b - README FILE DESCRIPTION RoboWeb is a suite of Perl scripts that allow for recording live user browsing sequences and insert assertions during them to later reproduce and automatically verify correctness of output of a web application. Recording test sequences is easy, just fire the roboweb_proxy script and make your browser point to it. The proxy will generate a test sequence script as you browse and you can insert "must_match" commands in the recorded sequence by entering regular expressions directly in your browser's URL box. These commands get translated into assertions that will be run against the server response text when the sequences are reproduced, to verify that server responses are correct. RoboWeb will also automatically put your web application backend database in a constant 'test-scenario' state before recording test sequences and before executing test scripts. This allows for reliable testing of complex web applications. After you collect a number of test sequences you can execute them via the TEST script, which will produce standard perl Test::Harness output. SUPPORTED PLATFORMS These scripts have only been tested on Linux, but will probably work under other unix variants and Windows NT. Currently the only supported database for test-scenario setup is MySQL. It wouldn't be too hard to add support for others, though. INSTALLATION 1. You will need a recent version of Perl and the following Perl modules: Data::Dumper Test::Harness LWP::UserAgent HTTP::Daemon Of these Data::Dumper and Test::Harness are part of the standard perl distribution. 2. After you install these modules proceed to unpack the tarball distribution. tar -xvzf RoboWeb-1.0b.tar.gz 3. If you want to do serious testing of a web application then you'll want to have RoboWeb put your database in a known state by restoring the database from a set of "test-scenario" SQL files. This is needed because the URL links that a web application generates are many times dependent on the state of the database, and the test sequences that RoboWeb records will request exactly the same URLs that the application produced when the sequence was recorded. To do restoring of the test-scenario database you must first configure your database name, username and password in the variables $dbname, $dbusername and $dbpassword in file RoboWeb/Util.pm. After that you must dump the test-scenario database to the test_db directory. To do this change dir into the main distribution directory and run the "dump_test_db.pl" script. 4. Run the TEST script in the main directory. It will execute a couple of demo sequences from the t directory. The first sequence will test that the word 'search' appears in the main page of google.com. The second will navigate three levels down into yahoo.com while checking for the presence of some sub-category names. RECORDING TEST SEQUENCES 1. Change dir to the main directory and execute the script "roboweb_proxy.pl". ("perl roboweb_proxy.pl" from the command line). 2. Set your browser proxy settings to point to the roboweb proxy. (if you run on the same machine use "localhost" for host and 8080 for port. 3. Fire up your web application and point go to it with your browser. 4. Enter "start_rec" in the URL box of your browser. This will instruct the proxy to put your database in test-scenario state and start recording a test sequence. Proxy commands will return no output to your browser, in order not to interfere with your browsing. You'll only get "server returned no output" alert boxes as confirmation. 5. Browse into your application and insert assertions on the responses text as you browse. To insert assertions enter "must_match/REGEXP/" commands in the URL box. Eg.: after browsing to the Google.com main page I would enter "must_match/search/i" into the URL box to insert an assertion on the response text that would produce a test error is such page didn't contain the string "search" in it. You can also enter "must_not_match/REGEXP/ commands for the opposite effect. 6. End recording by entering "end_rec/sequence_name" into the URL box. The test script "sequence_name.t" will be saved in RoboWeb's main directory. 7. Test the newly created sequence. First put the database in 'test-scenario' state by running the "pristine_please.t" script ("perl pristine_please.t"). Second run the newly created script ("perl sequence_name.t") you'll see its raw output, which is human-readable. If the test is successful then you can move it to the "t" directory, so that it gets executed automatically alongside other tests in the suite when you run the "TEST" script. 8. As development of you web application progresses you can keep adding test sequences to your suite to keep track of any malfunctions introduced during development. AUTHOR Claudio Garcia. claudio.garcia@stanfordalumni.org Please send any support questions to roboweb-users@lists.sourceforge.net. LICENSING Copyright (C) 2001 Claudio Garcia This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.