GetValue Command Step in Step Configuration Wizard
A GetValue command retrieves the value of a field from a composite variable, possibly filtering by the values of other fields. Additionally, if the filtering operation yields multiple values, an aggregation operator can be applied to the values list.
To add a GetValue 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 GetValue step type, click thebutton to validate the selection, and specify the following parameters:
- Run Type: A GetValue 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 an user-defined procedure is executed and an additional action is performed. 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 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.
Specify the following Command String parameters:
- Composite variableselect the composite variable for which you want to retrieve the field values. The list of variables is available in the list that appears when you click the down arrow present on the field.
- Composite statistic to queryselect the statistics you want to retrieve. The list of available statistics for the selected variable is available in the list that appears when you click the down arrow present on the field. You can select multiple statistics from the list.
- Filter valuesspecify the filter values for the selected statistics.
To enable filters for selected statistics and define the filter values, do the following:
Click the drop-down button () at the end of the field.
The filter editor appears. The filter editor contains a list of statistics available for the selected composite variable.
Select the check-box against the statistics for which you want to enable filters. Select a Condition for the filter.You can select from any of the following conditions:
Equalsto filter statistics that are equal to the value specified in the Value column.
InRangeto filter statistics within a range specified.
Containsto filter statistics that contain the specified value.
Matchto filter statistics that match the specified regular expression.
Enter Value for the selected condition.You can select a value from the list that appears when you click the down-arrow. The list contains actual values of the selected statistics.
You can also type in an expression yourself. Variable autocomplete is available for this field so if you type `$' in the field a list of available variable names appears.
If the selected condition type is `Matches' you can also insert basic regular expressions. To access the list of regular expressions templates click the browse button that appears when `Matches' is selected as the Condition. The list contain only basic regular expressions, advanced expressions however, have to be typed in.
ClickOk.
- Aggregationif the filter result is a list of values, an aggregation operator (Avg, Min, Max, Med, Sum, First, Last) can be applied to the list such as to reduce it to a single value. For results that are enclosed in quotes, you can use the Merge operator to remove the leading and trailing quotes.
If an aggregator is not campatible with a statistics, the result of the aggregation is a NULL value. For example, if Interface Name, and Memory Utilization are the two fields selected and Average is selected as the Aggregation, the step returns NULL for the Interface Name and the average value in the Memory Utilization field.
- Return Variablethe TestComposer variable that is assigned the retrieved field value.
After you have specified the composite variables, statistics, filters, and aggregation the Command String resembles a Tcl-like expression.
Verify the step summary information and revert to a previous configuration step if needed. Click Finish.Example:
Assuming we had a composite_var variable holding two numeric lists, listA (1, 1, 2, 3, 1) and listB (a, b, a, c, d), you could use the following command to filter listB for the fields of listA that have a value of 1:
GetValue var1 composite_var listB listA 1
which would return a var1 variable having the "a b d" value.
The following command that also uses an aggregator:
GetValue var1 composite_var Count composite_var listB
listA 1
would instead return a var1 variable the "3" value.
IxLoad TestComposer │ User Guide |