Login | Register
My pages Projects Community openCollabNet
[ Installation ] Recording and Running [ Editing ] [ Recipes ] [ Command Line ]

Recording Tests

  1. Configure your web browser to use localhost:8090 as an HTTP proxy. The exact steps for doing this depends on which platform/browser you use. On Internet Explorer for Windows, do this:
    • Select Tools->Internet Options...
    • Click the Connections tab
    • Click the LAN Settings button at the bottom
    • Click the Use a proxy server checkbox
    • In the Address box, enter: localhost
    • In the Port box, enter: 8090 (or the custom port you specified)
    • Click OK

    NOTE: When you exit MaxQ, make sure to configure your browser to no longer use a proxy. Otherwise it will be unable to request pages.

  2. Start MaxQ by double-clicking bin\maxq.bat (Windows) or using the command line (UNIX):
    /Users/oliver/maxq$ bin/maxq

  3. Select File->New->Standard Script. This will generate the boilerplate code for your script.

  4. Use your web browser to go to wherever you want to start your test. Because you have not started recording, your web requests will go via MaxQ, but it will not add anything to the script.

  5. Select Test->Start Recording.

  6. Begin hitting the web pages you want to test. As you click on links, or submit forms, python code will be being generated in the MaxQ window.

  7. When you're done testing, select Test->Stop Recording. You'll be prompted to enter a filename where the test script will be saved. We suggest using the file extension .py for these files.

Running Tests

    From the GUI:

    • Start MaxQ
    • Select File->Open and load the script file you wish to run
    • Select Test->Run to run the script. A dialog box will open with the output from the test run.

    From the command line:

    See the command line page for details. Basically you start MaxQ with the -r flag, and pass in the file names of the script file(s) you wish to run. For example:

    maxq -r mytest.py
    Running tests against a different server

    Sometimes it's useful to run a test against a server other than the one you recorded the test on. For example, I usually record my tests against my local PC, but would like to re-run the test suite against my staging server before I deploy changes live. MaxQ provides a -u switch to make this possible. This flag should be used in conjunction with the -r switch. For example:

    maxq -u localhost:8000 stage.mydomain.com -r mytest.py
    Any get() and post() method calls in mytest.py that contain the string localhost:8000 would have that string replaced with stage.mydomain.com during playback. The test file itself is not modified on disk.