TclEval Command Step in Step Configuration Wizard
A TclEval step evaluates a simple Tcl expression or interprets a multi-line code fragment containing Tcl commands, operators and TestComposer variables.
To add a TclEval command step using the GUI scripting support:
While in the Test Steps pane, add a step by choosing the Actions > Add step... command. Select a TclEval command, click thebutton to validate the selection, and specify the following parameters:
- Run Type: A TclEval step can only be executed sequentially (Sequential).
- Delay: A delay specifying by how much step start is delayed. A delay value is automatically set when the step is added using the Capture functionality.
- Timeout: A period of time after which the step execution is considered to have timed out.
- Ignore step: When this option is selected, the step is skipped at execution time. Selecting this option is equivalent to right-clicking a step in the Test Steps table and choosing the Exclude command from the context menu that appears.
- Description: An optional step description can be associated with a step.
Click Next.
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.
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.
Click Next.
In the Expression Builder GUI, create a valid Tcl expression or a Tcl code fragment by double-clicking in turn the desired Tcl commands and operators, and TestComposer variables.For detailed information on using the Expression Builder and creating Tcl expressions refer to Using the Composer Expression Builder.
Click Next.
Verify the step summary information and revert to a previous configuration step if needed. Click Finish.Example:
Assuming we have a list variable named Tput_fps containing f(rame)p(er)s(econd) test statistics, the code sample below would iterate through the entire list searching for the maximum value, which is then assigned to the Max_Tput_fps variable. The last instruction converts the frame per second value to a bit per second value and uses the computed value to initialize the Max_Tput_bps variable:
# find the max in the Tput_fps list
foreach tput ${x.Tput_fps} {
if {$tput > $Max_Tput_fps} { set Max_Tput_fps $tput }
}
# calculate the max bps value
set Max_Tput_bps [expr {$Max_Tput_fps * $framesize * 8}]
IxLoad TestComposer │ User Guide |