Get Grinder on roll – Setup Guide

Setting up the Performance testing open source tool Grinder is pretty simple, you need to do the followings to get it on roll:

  1. Download the Grinder and unzip in specific directory
  2. Example directory contains few examples, you can copy the the grinder.properties file either to grinder home directory or alternatively you can create <project_name> directory in root folder and then place the grinder.properties files in it.
  3. Update the grinder.properties files as per your need. You can refer the comments put up for each property in property file. If you need further explanation, just drop your query in comment section of this post.
  4. You must have Java 5 or later. Set the appropriate java paths.
  5. Create the following batch/sh files:
  6. setGrinderEnvironment.cmd or setGrinderEnvironment.sh
  7. @ echo off
    Set GRINDERHOME=<full path to your Grinder home>
    Set GRINDERPROPERTIES=%GRINDERHOME%\<path of grinder.properties
     / full path if grinder.properties file is outside grinder home>
    Set CLASSPATH=%GRINDERHOME%\lib\grinder.jar;%CLASSPATH% <also set other jar files if required>
    export GRINDERHOME=<full path to your grinder home>
    export GRINDERPROPERTIES=$GRINDERHOME/<path of grinder.properties / full path if grinder.properties file is outside grinder home>
    export CLASSPATH=$GRINDERPATH/lib/grinder.jar:$CLASSPATH <also set other jar files if required>
  8. runConsole.cmd or runConsole.sh
  9. call <full path of setGrinderEnvironment.cmd>
    java -classpath %CLASSPATH% net.grinder.Console
    . <full path to setGrinderEnvironment.sh)>
    java -classpath $CLASSPATH net.grinder.Console
  10. runProxy.cmd or runProxy.sh
  11. call <full path to setGrinderEnvironment.cmd>
    java -classpath %CLASSPATH% net.grinder.TCPProxy -console -http > <script name e.g. grinder.py>
    . <full path to setGrinderEnvironment.sh>
    java -classpath $CLASSPATH net.grinder.TCPProxy -console -http > grinder.py
  12. runAgent.cmd or runAgent.sh
  13. call <path to setGrinderEnvironment.cmd>
    echo %CLASSPATH%
    java -classpath %CLASSPATH% net.grinder.Grinder %GRINDERPROPERTIES%
    . <path to setGrinderEnvironment.sh>
    java -classpath $CLASSPATH net.grinder.Grinder $GRINDERPROPERTIES
  14. Start the proxy using runProxy.cmd or runProxy.sh for windows and linux respectively. Set the proxy in your browser. Default proxy is localhost:80, so set the host as localhost and port as 80 in proxy settings.
  15. Run your application, and execute the steps you would like to record. Once completed, stop the proxy by clicking the stop button of proxy console panel. 
  16. Check the grinder.py file, you can see the recorded session over here. Make sure to have the same file in grinder.properties file what you have just recorded for playback.
  17. Start the playback session using runAgent.cmd or runAgent.sh command for windows and linux respectively.
    
    
  18. Check the performance and errors of your playback session in logs directory (logs directory path is configured in your grinder.properties file). Data file represents test performance stats and error shows the error thrown during the test.


You know, comment floor is all yours. I would appreciate, if you make use of it.