Table-Form Response Templates

Before reading on, please refer to the previous About Regions, Targets, and Markers section for general information on output blocks and targets.

Table-form Response Templates are based on device output formatted as a table that comprises rows and columns and containing one or more header rows.

A table-form template enables you to retrieve the values of individual targets, multiple occurrences of individual targets, and the values of entire table columns.

To edit a table-form Response Template:

  1. Click into the Response Template column, then click the Edit Response button next to the template that you want to edit.
  2. The Response Template Editor appears the same as shown in Figure:Response Template Editor Window, with the command's output displayed in the Command Response pane at the left.

  3. Select an area and click the Mark table area button.
  4. A TableArea item is added to the Regions pane. In the Properties pane, which displays the item's properties, edit the name and optional description as desired.

    If the marked table is contained repeatedly in the output command, and provided you want to retrieve the target values corresponding to the multiple occurrences, select the Repeating search option for the table region.

  5. Select a header, possibly containing multiple lines, and click the Mark header button.
  6. A Header item is added to the Regions pane. In the Properties pane, which displays the item's properties, edit the name and the optional description as desired. If there are additional lines that separate the table header from the actual data area, configure the Non-data lines following header parameter to the number of separating lines.

  7. Select a column's header within the header line and click the Mark full column header button.
  8. A Column item is added to the Regions pane. In the Properties pane, which displays the item's properties, edit the column name and the optional description as desired. Set the column's data type to either Number or String.

    The Values field displays a list of all the column values.

    If you wish to retrieve the column values list, select the Export results option and choose the Save or Save as commands from the File menu to save the Response Template into the plugin's resources database.

    Skip the remaining steps of this procedure.

    When using the Mark Full column header, take care to mark an area that occupies the maximum anticipated number of characters for the column, or which spans the entire width of the data column. Failing to do so may result in retrieving incorrect results from the command output.
    For example, considering that you have the following command output:
     
    for the PID column, the values of the first column can be is fully collected only if you also select the spaces in front of the `PID' text as being part of the column, as shown in the sample image above.

  9. For defining a simple target, select a target in the previously defined column and click the Create target in table button.
  10. In the Properties pane, edit as follows the properties of the Target item that is added to the Regions pane:

    • Target name: An automatically assigned target name
    • Target data type: The target data type, which can be String or Number
    • Target description: An optional target description
    • Type of target: Table target
    • Name of column to get value from: The name of the column containing the target
    • Type of table reference: The reference type, which can be any of the following:
      • Search by row index: To retrieve the table value, specify the explicit row number of a particular column.
      • Search by value of other column: To retrieve the table value, specify the value of a reference column. The retrieved value then corresponds to the row entry having a specified reference in the reference column.
    • Column row index: The table row index of the target. You can enter absolute values (only numeric) as well as variables as input here. To enter a variable, you need to precede it with a dollar sign ($).
    • Name of column to reference: The reference column that must be specified when you choose the Search by value of other column option.
    • Comparison operator: When you have chosen to define a target that re-ferences the value of another column, this operator determines the comparison operation performed on the reference column.
    • For example, in the case of the default value, the `=' operator, the value searched for in the reference column is a value that matches the Value of the reference column.

    • Value of the reference column: The reference value that must be specified when you choose the Search by value of other column option. If you have previously chosen the Search by row index option, this value is set to N/A. You can enter absolute values (both numeric and string) as well as variables as input here. To enter a variable, you need to precede it with a dollar sign ($).
    • Value selected: The actual value of the selected target.
    • For targets within table-format regions, the Regular expression template, Regular expression, Value of C1, and Repeating search fields are not available.

    • Export results: When this option is selected, the target becomes available as a statistic via the step return variable.
    • If at step 3 above the Repeating search option was selected, the selected value is a list of values corresponding to the multiple occurrences of the marked table.

  11. To add multiple targets, repeat step 5 for each target that you want to add.
  12. Alternatively, selecting a region or a target entry in the Regions pane and clicking the button removes it from the pane.

  13. Choose the Save or Save as commands from the File menu to save the Response Template into the TestComposer resources database.
Example 1:

Considering the command output shown by the image below, containing three occurrences, and assuming we were interested in retrieving the IP addresses from the Link ID column, we would mark the first table occurrence as a table region with the Repeating search parameter selected, the upper table row as a header, the Link ID column as a full column header, and the IP address as a simple target.
 
For the given example, the target value displayed in the Value selected field would then be {172.21.254.1 173.22.254.1 101.0.0.1}.

Example 2:

Considering the command output shown by the image below and assuming we were interested in retrieving the IP addresses from the Gateway IP column, we would mark the table area as delimited by the red rectangle, the header containing the upper 2 table rows as delimited by the green rectangle, and the `Gateway' word as a full column header.
 
For the given example, the target value displayed in the Value selected field would then be a list of IP address values, each entry separated by `{` and `}' characters. Note that for this example, since there are no additional lines between the table header and the actual data area, you can leave the  Non-data lines following header parameter to its default `0' value.

While working with the Response Template editor, when you choose an item in the Regions pane, the corresponding area in the command output is highlighted, as shown below:

While working with the Response Template editor, you can use the
Edit > Paste command to replace the Command Response pane content with some pasted text.

A LineTable region is a simplified table, containing a header row, a delimiter row, and a single or multiple data row(s). When defining such a region, the entire table needs selected and the retrieved value is the first entry below the delimiter line on a specified column. Similar to the regular tables, a LineTable region can be marked as repeating by selecting its Repeating search option.
For example, considering the sample output below, if we marked the entire text area as a LineTable and the Line ID string as a target (using the Create target in Table button), the retrieved value would be the IP address below the delimiter.
 

More sample free-form and table format Response Template creation procedures are given in Appendix B, Response Templates Creation Samples.