Data Selectors Panel

Applies to LoadComplete 4.97, last modified on May 20, 2019

About the Data Selectors Panel

On the Data Selectors panel, you view and create data selectors – special rules for extracting data from server responses and saving this data to variables. You can then use the extracted values to parameterize subsequent requests or to check the response data.

LoadComplete uses the panel for these operations:

Here are sample views of the panel:

HTTP Requests

Data Selectors Tab

Click the image to enlarge it.

By default, the Data Selectors panel is on the Response page
of the Request operation editor (as data selectors apply to responses).

WebSocket Server Messages

Data Selectors Tab

Click the image to enlarge it.

Child items of a selector correspond to requests or client messages that use the data extracted by the selector. You can also view these requests and client messages in the Provides Data For panel displayed by default side-by-side with the Data Selectors list (see the image above).

You can double-click a request or client message under the selector to open a data replacer that inserts the extracted data to the request or client message.

Using Data Selectors

Columns

Column Description
Rule How the data selector was created:
  • User - The data selector was created or edited by a user.
  • Rule_Name - The data selector was created by a correlation rule, where Rule_Name is the name of the rule. (LoadComplete tracks dynamic parameters passed from responses to subsequent requests and creates correlation rules. See Data Correlation).
  • Legacy item - The data selector was created in a LoadComplete version prior to version 4 and converted to the current format.
Area Specifies the part of the response, from which the selector will extract data:
  • Body (RegExp)

  • Header (RegExp)

  • Body (Path)

  • Header (Path)

  • Cookie

Used for HTTP requests only. For WebSocket messages, this column is hidden.

Expression Specifies the search pattern the data selector will use to find data. You can enter the search pattern manually, or specify one or multiple variables that form the needed pattern. See below for details.
HTTP Requests

The value you specify in the Expression column depends on what you set in the Area column:

  • Body (RegExp) or Header (RegExp)

    The Expression column specifies a regular expression that the data selector will apply to the response body or response header. (In the last case, LoadComplete takes the whole header text and applies the regular expression to it). You can specify a complex regular expressions that extracts a larger piece of  data, and use subexpressions (groups) in this expression to save a smaller piece of data to a variable. In this case, you have to use the Attributes column to specify the subexpression (see below). For information on regular expression syntax, see Regular Expressions Syntax.

  • Body (Path)

    The Expression column specifies the name of the server response parameter whose value the data selector will extract. For Rich Internet Application responses, specify the parameter name starting from the root element name in the response, for example, Message[1]/[1]/clientID.

  • Header (Path)

    The Expression column specifies the name of the response header parameter, whose value the data selector will extract. For example, Response/Protocol. You can see the parameter names and hierarchy in the Request Header panel.

  • Cookie

    The Expression column specifies the name of the cookie, whose value you would like to obtain.

WebSocket Messages

Same as for the Body (RegExp) area of the HTTP request. That is, either a regular expression, or one or multiple variables. See above.

Note on setting the cell value

You can either enter the search expression in the cell, specify a single variable that contains the expression, or specify a combination of variables that form the needed expression.

To specify a variable, use the following syntax:

\vVariableName\v
– or –
@VariableName

To concatenate variable values and data, use the \vVariableName\v syntax, for example:

data1\vVariable1\vdata2\vVariable2\vdata3

Attributes This column is used if the Area column has the Body (RegExp) or Header (RegExp) value, that is, if you create a regular expression for response body or header (or for a WebSocket message). For Cookie, Body (Path), and Header (Path) areas, the Attributes column is ignored.

If you specify a regular expression in the Expression column, then the Attributes column specifies a subexpression (or group) that points to the smaller piece of extracted data to be saved to the variable. Subexpressions (groups) are part of the regular expression enclosed in parentheses, for example:

[: \#\?&]gfe_rd=(.*?)[&\r\n]

The Attributes value should specify the subexpression in the format $number, where number is subexpression position (from 1) in the regular expression. $1 matches the first subexpression (group), $2 matches the second subexpression and so on. $0 matches the data returned by the entire regular expression. For more information on using the Attributes column, see Working With Subexpressions.

Variable The variable, to which LoadComplete will save the extracted value. You can specify any variable available in your project, that is, the variable can be defined in the scenario you are editing, or in any other scenario of your project, or in any wizard. If the specified variable does not exist, LoadComplete will create it. If you specify an existing variable, LoadComplete will overwrite its value.
Convert Specifies whether LoadComplete will encode or decode data after extracting them from the response. The variable, to which you save the extracted data, will store converted value. This is needed, for example, if you want to insert a variable to a header or cookie of the subsequent request, and this header’s or cookie’s value requires data in a different format than extracted data. A typical example is replacing URL-encoded characters (like %20, %2B, and others) and HTML entities (like &, <, >, and others) with their textual presentation, or vice versa. You choose the decoding or encoding format from the drop-down list. For more information on conversion, see Converting Correlation Data.

Creating, Editing, and Deleting Data Selectors

To create a data selector

To edit a data selector

To delete a data selector

Related Topics of Interest

See Also

Regular Expressions Syntax
Create Data Selector Wizard
Request Operation
WebSocket Connection Operation
WebSocket Server Message Operation
Data Replacers Panel
Scenario Editor - Common Tasks

Highlight search results