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

A list variable holds a list of values (for example, logins or passwords) to be used in scenarios. Each list variable specifies the order, in which virtual users access list values. For example, each virtual user can use only one specific value from the list or take the next value every time the user simulates a request to the server.

You can use list variables to specify query string parameters of GET requests as well as the form fields sent via POST requests, for example:

GET /find/?first=@FirstName&last=@LastName HTTP/1.1

We recommend that you select a variable whose data type matches the parameter data type. If LoadComplete fails to convert the variable value to the parameter data type, the test server may raise an error.

Depending on the value access type specified for the list, different virtual users will be able to play back the parameterized request using different parameter values, for example:

GET /find/?first=John&last=Smith
GET /find/?first=Susan&last=McLaren
GET /find/?first=Charles&last=Dodgeson
and so on

This way, you will get more realistic behavior rather than by using the same recorded value for all virtual users.

For more information about using variables in requests, see About Variables.

Parameters

List variables have the following parameters:

Name

The variable name, which LoadComplete will use to refer to the variable in requests. The name can include only letters (A..Z, a..z), digits (0..9) or underscores ( _ ) and must be unique within the project.

Value

A list of values. For example, a list of logins, passwords or product IDs. You can enter the needed values manually or generate a sequence of values using LoadComplete’s built-in data generator. For details, see the Managing List Values section below.

Note: LoadComplete stores values of list variables in the test project. To store values in an external file, use the Excel, CSV, or database variable instead.

Value Access Type

Specifies the order, in which virtual users take values from the list:

  • Item index equals virtual user index
  • Item index equals virtual user index within a station
  • Next value on each use
  • Next value on each use within a station
  • Next value on each use by a virtual user
  • Random

For complete information on these settings, see Value Access Types.

Managing List Values

A typical way to fill in the list is to enter the needed values manually. This works well for a few values, but if you need a long list of values (say, 300), entering all of the values manually can be ineffective. In this case, you can make use of LoadComplete’s built-in data generator to fill the list with values matching the needed criteria or patterns.

You can also load a list of values from a text file.

Entering Values Manually

You set a variable’s values on the List Variable Contents page of the Variable wizard.

To add a new value to the list, click Add and then enter the needed value.

To modify a value, click it in the list, enter a new value and press Enter.

To delete a specific value, select it in the list and click Delete.

Generating Values

Instead of entering list values manually, you can have LoadComplete generate them for you based on certain criteria:

  • On the List Variable Contents page of the Variable wizard, click Generate. LoadComplete will open the Generate Value dialog.

  • In the Number of rows box, enter the number of values to generate.

  • In the Data Generator list, select the type of values to generate - names, e-mail addresses, dates, and so on. For the complete list of available data generators, see Data Generators.

  • Specify the data generator parameters. For more information about available parameters, see a description of the corresponding data generator.

    An example of data generation parameters for a list variable

    Click the image to enlarge it.

  • Click OK.

If your list variable already has any values, the data generator will replace them with the generated data.

Loading Values From a Text File

You can store your values in a text file, one value per line, and load these values from the file to the list variable:

  • On the List Variable Contents page of the Variable wizard, click Generate. LoadComplete will open the Generate Values wizard.

  • In the Data Generator list, select Value From a Set.

  • Click Load From File and then select the text file that contains the value list. LoadComplete will read the file line by line and display the lines in the Custom values list.

  • Set Generation mode to Sequential.

  • In the Number of rows box, enter the number of values to load from the file.

  • Click OK to close the Generate Values dialog and fill in the variable’s values.

Note: LoadComplete copies the values from the file to the list variable and store these values in your test project. To bind a variable to a file and read values from that file directly every time you run your test, use the Excel, CSV, or database variable instead.

Sorting Values

You can sort values in list variables:

  • Double-click the list variable in the Variables editor. LoadComplete will open the List Variable Contents page of the Variable wizard.

  • Use the Move Up and Move Down buttons to change the values order in the list.

  • Click OK to save the changes and close the wizard. Click Cancel to close the wizard restoring the previous value order.

See Also

Excel Variables
CSV Variables
Database Variables
Incremental Variables
Constant Variables

Highlight search results