User Zone HowTo: Recording Browser Sessions
TestGen4Web-Python
Installing and Running
To create TestGen4Web tests or to play previously recorded tests, you will need to download and install the TestGen4Web FireFox extension. Be sure to restart after installing the extension.
With the extension installed, you can load a recorded session with the "Open Recording" browser bar icon. Hit the "Play" browser bar icon to run the test. The current list of Zenoss test session files (used for our regular functional/integrated testing) is here:
Converting these tests to python depends upon the following:
For more about how we at Zenoss are using TestGen4Web, see Functional Testing for Zenoss.
Both of these packages (as well as their dependencies) are up on cheeseshop, so if you have setuptools installed, you need only do the following:
sudo easy_install TestGen4Web-Python
Or, to upgrade:
sudo easy_install --upgrade TestGen4Web-Python
If you do not have setuptools installed, download ez_setup.py and run it in the following manner:
sudo python ez_setup.py
Once setuptools is installed, you will be able to install TestGen4Web-Python as described above.
See TestGen4Web-Python Release Notes for more information.
Testing the Tester
To make sure that your TestGen4Web-Python installation is working properly, several tests are included in the source distribution. These tests start up a mini-webserver in python and then execute a series of unit tests based on pre-recorded sessions against the mini-webserver.
To run these tests:
- download the source file
- tar xvfz TestGen4Web-Python-0.2.tar.gz
- cd TestGen4Web-Python-0.2/tests
- python test_parser.py -v (these are doctests)
- python test_mechunit.py (these are the tests that use the mini-webserver; they require that you have port 10001 unused)
If you want to add unit tests to TestGen4Web-Python, see this page?.
Converting TestGen4Web XML Sessions to Python
There are several ways to use testgen:
- testgen-convert - Run the testgen-convert script against TestGen4Web .xml file
- single-source - Create a unittest python file for a single .xml file
- multi-source - Create a unittest python file for multiple .xml files
- zopectl integration - Create a ZopeTestCase-based unittest file to be run with zopectl test --libdir [your product]