ReadWriteGlobal
Statement Step in Step Configuration WIzard
Defines a global TestComposer variable and assigns it a user-specified value or an expression that may contain local variables. Alternatively, the statement is also used for assigning to a local variable the value of a global variable.
Opposed to local variables, defined and visible either in the main script procedure or in the bodies of local procedures, global variables are visible throughout the entire script. Because of this behavior, global variables are used for transferring the value of local variables between the main script body and the bodies of procedures, or from a procedure body to another procedure. For more information on the global variable type refer to About Variables.
To add a ReadWriteGlobal statement step:
While in the Script Steps pane, add a step by choosing the Actions > Add step... command. Select a ReadWriteGlobal step type, click thebutton to validate the selection, and specify the following parameters:
Define the Conditional Execution settings as explained below.Conditional Execution settings enable you to define the system conditions a script step execution is monitored for. When such a predefined condition occurs a step error or a step timeout an user-defined procedure is executed and an additional action is performed. For example, on encountering a step error, you could enforce the execution of a cleanup procedure and then terminate the script.
To monitor the step for a predefined Timeout or Error condition, select the corresponding condition, then define the associated procedure local or shared (external) by clicking the
control of the Procedure field and selecting a procedure from the the drop-down pane that appears.
For the selected procedure you can view its defined arguments by clicking the
control of the Input Arguments field, which displays a cascading table-format pane containing the argument list. To specify the actual runtime argument(s) enter the desired values in the Current Value field(s).
Configure an additional action by clicking into additional actions column and selecting either of the following options:
- Continue: After performing the specified procedure, the script execution continues.
- Exit Test: After performing the specified procedure, the script execution is terminated.
Click Next.
Whenever the step execution is monitored for predefined events, an
icon is displayed in the step's corresponding Events selected column entry. For information on turning on the displaying of the Events selected column refer to Customizing the Script Steps Table Layout .
With the Global option selected, specify a global variable to create by clicking into the field and editing its name in place. At the next step, you can assign it a local variable or a constant value.Alternatively, when the Local option is selected, you can specify a local variable, whom you can then assign it a global variable.
Click Next.
Select the Local or Constant options and assign a local variable or a constant value to the previously defined global variable.Alternatively, if a local variable was specified at the previous step, you can assign it the value of a global variable.
Click Next.
Verify the step summary information and revert to a previous configuration step if needed. Click Finish.The global variable that was initialized with the value of a local variable can then be used in a procedure body to transfer the value to a local procedure variable using another ReadWriteGlobal statement.
The operations sequence above illustrated the case of a local variable that needs to be referenced in a procedure body. A symmetrical case involving a local procedure variable whose value needs transferred to the main script body would require creating a global variable in the procedure body (at step 4) and then assigning it the value of the local procedure variable (at step 5). In the main script body an additional ReadWriteGlobal statement would need to assign a local variable the global variable defined within the procedure body.
As evident from the examples above, transferring a local variable value between the main script body and any of the procedures is done using a number of two ReadWriteGlobal statements.
IxLoad TestComposer │ User Guide |