The Test Variables Pane

The Test Variables pane enables you to reference and use local variables in Tcl expressions and code fragments.

As stated before, global variables cannot be referenced in expressions or Tcl code fragments.

When accessed, the Test Variables pane displays the TestComposer variables defined in the previous steps, either through assignment operations or specified as variables holding return values for other steps. In addition to variables, defined script parameters are also displayed in the Test Variables list.

The following local variables types are supported:

  • Simple variables: These are simple variables, such as scalars (boolean, integer), strings, and lists, that have a Tcl representation and are directly accessed in Tcl expressions using a $ reference.
  • Simple variables are used in Tcl expressions, such as those encountered in Assign and TclEval steps, or in conditional expressions associated to flow control steps.

  • Composite variables: This structured variable type does not have a Tcl representation and represents, for example, Response Templates targets. Composite variables may contain multiple elements, such as statistics groups, dimensions, and statistics values.
  • TestComposer composite variables are displayed in tree form expanding below the variable name and may comprise statistics aggregated into groups, as shown for example in Figure:Structured Variables Representation:

    Figure:Structured Variables Representation

    Since composite variables do not have a Tcl representation, accessing these variables is commonly done using the GetValue command.

    Filters can be used on composite variables. To enable filters for selected statistics and define the filter values, do the following:

    1. Click the browse button at the end of the field.
    2. The filter editor appears. The filter editor contains the list of statistics.

    3. Select the check-box against the statistics for which you want to enable filters.
    4. Select a Condition for the filter.
    5. You can select from any of the following conditions:

      Equals - to filter statistics that are equal to the value specified in the Value column.

      InRange - to filter statistics within a range specified.

      Contains - to filter statistics that contain the specified value.

      Match - to filter statistics that match the specified variable.

    6. Enter Value for the selected condition.
    7. You can select a value from the list of available regular expressions that appears when you click the down-arrow.

      You can also type in the expression yourself. The list of expressions contain only regular expressions, advanced expressions however, have to be typed in.

    8. Click Ok.
    • Return Variable - the TestComposer variable that is assigned the retrieved field value.
    • Composite variables are created following an association with either of the following entities:

    • Resource Template: Targets defined in Response Templates associated to command steps are `wrapped' in composite variables.
    • Execute steps: The return values of a number of Execute-type steps for different protocols, such as SNMP for example, are also contained in composite- type variables.
    • Variables of this type are referenced using the . (dot) operator following the composite variable name.

      When the composite variable fields contain lists, such variables can also be referenced using dimensions; considering, for example, the results variable containing the Protocol_HTTP_Clientstatistics group (Figure:Sample Composite Variable Access):

      Figure:Sample Composite Variable Access

      and the following GetValue function call:

      GetValue results.Protocol_HTTP_Client HTTP_SimulatedUsers Elapsed_Time 10

      this call returns the HTTP_SimulatedUsers statistic value for an Elapsed_Time value of `10'.

    • Matrix: These composite variables, which contain statistics results in matrix format from IxLoad commands, are obtained using StatGet or StatQuery function calls.
    • Considering, for example, the following command call:

      Stat Get ports=(6.1,6.2) stats=-framesSent,
      -framesReceived

      results in a three column result matrix with the ports, framesSent, framesReceived columns containing each a numeric values list.

      To retrieve the framesSent value for the first chassis port you would then use a function call as follows:

      GetValue results framesSent ports (1.6.1)

    For additional information on the GetValue Tcl function refer to GetValue.

    The structure of composite return variables assigned to Execute steps for the IxLoad session are made available without previously executing the step command, provided the session is active.

See Also

The Tcl Commands Pane

The Operators Pane

The Expression Pane