Aggregating Multiple Badboy Scripts into One

If you have a large number of tests, or conversely, if you have tests that are very large then you can take advantage of Badboy's ability to call one Badboy Script from another Script. This feature allows you to break your tests into individual Scripts and then write a Master Script that calls all your other Scripts. This is called "Script Aggregation".

Creating an Aggregate Script

To create a script that Aggregates another script:

  • Create a new script and drag an "Aggregate Script" item from your Toolbox into your script at the point where you want the aggregated script to run.
  • A properties dialog should show, allowing you to choose the Script you would like to run in a text box that is provided.

When played, an Aggregate item launches a separate instance of Badboy and plays the aggregated Badboy Script all the way through, automatically exiting the created Badboy instance when it is complete. Note that the Aggregate item will wait for the called script to finish before continuing. When the aggregated Script is finished the Aggregate item will load the summary statistics from the called Script as its own so that you can see the statistics for all played scripts from your Master Script. As with other playable items, you can see statistics for any group of Aggregate items by selecting the Step that contains them.

The figure below shows how an Aggregate Script appears:

Aggregate items are just a special kind of Schedule Item where the scheduled script is configured to run immediately. Hence you can turn an Aggregate item into a Schedule item and vice versa just by changing the Schedule option between "Now" and "Later" You can read more about Scheduling in help section Scheduling Badboy Scripts.

Passing Variables to the Aggregated Script

Often you will want to control variables from your master script and have any aggregated scripts inherit those values. For example, if you have created a "host" variable to control which website you are testing, you would naturally want aggregated scripts to also use that same value.

To make variables in your master script get passed to a called script, check the "Inherit Variables" option in the Aggregate Item's properties.

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