Using the Command Line Runner

While Badboy's GUI interface is very powerful and simple to use, sometimes advanced users may wish to run scripts without showing a window at all. There are some common scenarios where this can be very useful:

  • You want to run Badboy tests as part of a script or an automatic schedule. Using the command line runner, you can create a batch or shell script to run Badboy at a scheduled time each day to monitor the performance or stability of your web site.
  • You want to create a large load on a server. Running Badboy's GUI inevitably takes some resources and can slow down your test. If you run the script via the command line you may be able to simulate more users than otherwise.
Limitations of the Badboy Web Test Engine

Because Badboy uses its own test engine to run your scripts in command line mode you may experience some different behaviour in this mode to that of a normal browser. The most noticable issue that most users will experience is that Badboy's Web Test Engine cannot run JScript or VBScript. However even if your site uses these languages there is still a good chance that scripts you create will work with Badboy's command line runner anyway. This is because most sites only use client side scripting for user interface effects, which do not affect the command line runner. There are cases, however, where the operational functioning of a site may require the use of JScript and thus these operations may fail when you run them in the command line runner even though they succeed in Badboy's GUI. If your scripts must run in a GUI to execute, you may like to try automating Badboy through OLE instead of using the command line runner (see Automating Badboy with OLE).

Running a Command Line Script

Running a command line script is easy. The most important thing that you will need to do is to make sure that the Badboy install directory is in your system's PATH variable. Alternatively you can run the scripts from the Badboy install directory. A command to run a script will usually take the form:

Example:

  bbcmd -i 1 test.bb
  Badboy Command Line Runner Version 1.3
  Copyright (C) Badboy Software 2001-2003. All rights reserved.

  Loading archive...Loaded.

  Launching 1 threads...
  Url=http://www.google.com/:status=200:704 bytes
  Url=http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=test&btnG=Google+Search&bbrand=18467:status=200:883 bytes
  All threads finished

  ============== Summary Statistics ======================

  Url                       Response Time         Responses       Errors
  ----------------------------------------------------------------------------------
  www.google.com/ (5)         243                  1               0
  www.google.com/search (8)   460                  1               0

Command Line Options

The command line runner supports many command line options to allow you to customize how the script is played. To see these options, just type "bbcmd" without any options.

Example
    Badboy Command Line Runner Version 1.3
    Copyright (C) Badboy Software 2001-2003. All rights reserved.

    Usage: bbcmd.exe [options] 

    Options are:

     -n <number of threads>
     -s <stagger time between threads>
     -d <duration to run for in seconds (all threads terminated after this time)>
     -i <iterations to perform (per thread)>
     -D <name>=<value> : defines or sets a variable with this name and value
     -c : causes report to collate statistics for identical Urls together
     -v : causes verbose logging of responses (extremely verbose)

HTTP Authentication and Proxy Authentication

Badboy has elementary support for Basic Authentication in bbcmd. You can enable this by setting environment variables as described in the table below:

Environment VariableEffect
BADBOY_AUTH_USERUser name supplied for HTTP Basic Authentication
BADBOY_AUTH_PASSWORDPassword supplied for HTTP Basic Authentication
BADBOY_PROXY_AUTH_USERUser name supplied for Proxy Authentication
BADBOY_PROXY_AUTH_PASSWORDPassword supplied for Proxy Authentication

Badboy Documentation Generated on Mon Dec 29 22:28:41 EST 2008