gtklogger is a Python module for recording (capturing) and replaying a session of a program.
Version: 1.1gtklogger is a Python module for recording (capturing) and replaying a session of a program with a graphical user interface written with PyGTK. It was developed as part of OOF2, a program for computing the properties of materials with complicated microstructures, but it can be used with any PyGTK program. The gtklogger program is somewhat similar in spirit to PyUseCase, but the implementation is very different.
Operating System: Linux
gtklogger enables a test suite to be written for the user interface of a PyGTK program. A PyGTK program that imports gtklogger and has been suitably modified can record a user session in a log file. Tests can be added to the log file, and the file can be replayed by the program. If the file plays to completion and passes the tests, the program is working correctly (or, at least, not known to fail).
The modifications to a program that are required by gtklogger are not onerous, and do not interfere with normal operation of the program.
A simple PyGTK program called gtkloggerdemo.py demonstrates how to use gtklogger. The program files contain a multitude of comments describing how the original program was modified. It can be downloaded as a gzipped tar file here (6 KB). Unpack it with
tar -xzf gtkloggerdemo.tar.gz
To run the program without logging, simply run
To record a session into a file called logfile, instead type
python gtkloggerdemo.py --record=logfile
To replay a recorded session from logfile, type
python gtkloggerdemo.py --replay=logfile
To re-record a session from logfile, type
python gtkloggerdemo.py --rerecord=logfile
The downloaded package is a compressed tar archive. If your browser didn't unpack it for you, unpack it like this:
tar -xzf gtklogger-1.1.tar.gz
This will create a directory called "gtklogger-1.1"
cd to that directory.
Install gtklogger by typing:
python setup.py install
to install it in the standard location for python packages (you will need root privileges), or
python setup.py install --prefix=otherdir
to install it in otherdir. You will need to have write permission in otherdir and will need to place otherdir/lib/python2.x/site-packages in your PYTHONPATH (for an appropriate value of 2.x).
What's New in This Release:
· ComboBoxes are now logged by content, not row number, if possible. This means that adding new entries to a ComboBox won't invalidate old test scripts.