Automatic Variables

Automatic Variables are variables that are available in all your scripts without you having to add them manually. These variables are useful in a number of circumstances:

  • Sometimes there is a common variable that you add to all your scripts. You can avoid having to do this by instead making an Automatic Variable.
  • There might be a variable that you would like to have in your script but you don't want it to be saved with the script. For example, you might not want to save passwords into your script since then if you send the script to someone else they will be able to see it. You can avoid this by making the password into an Automatic Variable.
  • Automatic Variables can also be very useful for handling dynamic content on your site when you use the ability of Variables to update their values from page content. If you have a particular value that you would like to hold in a variable no matter where or when it appears on your web site you can make an Automatic Variable for it and then the value will be available to all your scripts without having to add anything to the scripts themselves.

Adding Automatic Variables

Automatic Variables are configured in the Badboy Preferences dialog. To add an Automatic Variable, go to the Preferences menu and select "Preferences" and then click on the "Variables" tab. The figure below shows how the Automatic Variables tab looks:

Changes to Automatic Variables

When you play your script you can make changes to Automatic Variables just like you can to ordinary variables. In fact, Automatic Variables work just like ordinary variables in nearly all respects. One difference, however, is important: values of Automatic Variables are not saved with your script. Instead they are saved as part of the Badboy Preferences. This means that although your script can modify the values of automatic variables, other scripts will not see the modifications. If you want to make a permanent change to the value of an automatic variable then you have to do it by changing the variable in the Preferences.

If you are familiar with the concept of environment variables, you can think of Automatic Variables as being a bit like environment variables for Badboy. Just like environment variables, scripts get the values of the Automatic Variables when they are opened. After that they can be modified but the changes are only visible to the Badboy process that is running the script.

Predefined Automatic Variables

Badboy comes with some Automatic Variables built in when you install it. These are common variables that are helpful to applications built on web frameworks such as Java Servlets and ASP.NET. They help by capturing session id's and form states to ensure scripts play back properly, even when the server uses different unique values for each web session. If you don't need these variables you can delete them, however they shouldn't cause you any trouble and can help make testing applications built on these common frameworks much easier.


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