Wednesday, November 03, 2010

Load Testing with Python Multi Mechanize : The setup

Few week back, I was demonstrating a script to open a webpage with python using mechanize. Extend upon that, I use this along with multi mechanize. A Python based tools to do load testing on a webpage. What it does differently with mechanize is, this actually run a set of test script in parallel. And you can use any library to access the page, it can be mechanize, or urllib or httplib.

To setup, you will need python 2.6 above. Because it uses multiprocessing module that is available for python 2.6 and above. You will also need matplotlib which also require scipy.

Then you just download multi mechanize and extract the file to any accessible directory. Go to the project folder there will be a default folder, that is a example project. A project will need 2 folders and a config file, create a new project folder, within it create results directory, and a test_scripts directory, and copy config.cfg from default folder.

Next round we going to write a script