Open System Testing Architecture


Modeling a Script

After creating a Script you can model it by using variables to more accurately simulate the behavior of real users when the Test that references the Script is run.

The following example documents the procedures involved in modeling a user name and password to enable the simulation of multiple Virtual Users when a Test is run.

Modeling a Script involves:

Note: Use the SCL Reference Guide if you need help using Script Control Language. There is an on-line copy shipped with the Script Modeler Module, or you can download or view it from

Open a Script from Commander
  1. In the Repository Window within Commander, double-click Scripts, to expand the directory structure.
  2. Double-click on the Script FINDBYNAME.
    Script Modeler is launched, opening the Script you have previously recorded.

Create and Apply Variables
  1. With your FINDBYNAME Script open, click Variable > Create.
    Shortcut: Click in the Variable Toolbar.
  2. In the Variable Creation dialog box, enter a name for your new variable. In this example the name is USERNAME.
    Note: The name you give must be an OpenSTA Dataname.
  3. Select the Scope of your variable.
    In this example the selection is Script.
    Note: The scope of a variable relates to which Virtual Users and Scripts can make use of the variables you create.
  4. Select the Value Source of your variable.
    In this example the selection is Value List.
  5. Select the order in which the variable values are selected when a Test is run.
    In this example the selection is Sequential.
  6. Select the data types of the variable.
    In this example the selection is Character.
  7. Click Next when you have made your selections.
  8. In the Value List dialog box you need to enter the variable values, or names that will represent the Virtual Users you need when the Test is run. In this example there are five values or user names entered manually within the Value List dialog box, in this example they are:
    phillip, allan, david, robert and donna.
    Click Add Value and enter the first name.
    Repeat this process until you have entered all the values.
  9. Click Finish when the setup process is complete.
  10. Repeat this process to create the PASSWORD variable, which your five Virtual Users will need in order to access the Which US President? Web site.
    Note: This Web site requires a password to be the reverse spelling of the login name.
    The variables you have created are represented as text strings within the Definitions section of the Script, as illustrated below:
 	 CHARACTER*512 USERNAME ( "phillip", "allan", "david" & 
 	 , "robert", "donna" ), SCRIPT    
 	 CHARACTER*512	  PASSWORD ( "pillihp", "nalla", "divad" & 
 	 , "trebor", "annod" ), SCRIPT
The variables are now ready to be substituted for the original login identity recorded in the Script.
Obviously something happened here ... there are no instructions on how to then make use of these vars in your script :-(
Please Check this documentation for help on using the variables
  1. Select Capture > Syntax Check or click , in the Capture/Replay Toolbar, to compile your Script.
    Compilation results are reported in the Output Pane. If compilation is unsuccessful, you may need to re-model to resolve the problem.
  2. It is a good idea to replay the Script to check the activity you have recorded before you incorporate it into a Test.
    Select Capture > Replay or click , in the Capture/Replay Toolbar. The replay activity is displayed in the Output Pane.
  3. Click , to save your Script, or click File > Save.


The Script is now successfully modeled and ready to be incorporated into a new Test. Go on to the next section for information on creating Collectors, which are used to monitor and collect performance data during a Test-run.

Next Section: Creating Collectors

Back to Contents
Mailing Lists
Documentation feedback