Creating, Modifying and Deleting Variables

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

This topic explains how you create, modify and delete variables in LoadComplete.

Creating Variables

To create a project variable:

  1. In the Variables editor, click New Variable on the editor’s toolbar.

  2. LoadComplete will open the Variable wizard.

  3. Follow the wizard instructions to create a variable that accesses the needed data.

– or –

  1. On the Select Variable page of the Parameterization wizard, select New variable and enter the variable name.

  2. Follow the further wizard instructions to set the variable type and the way it will access the needed data.

Note: To create list, incremental, random, constant, and current date variables, select LoadComplete Variable in the wizard.

To create a scenario variable

  1. Open your scenario in the Scenario editor.

  2. Define a rule that will extract the needed data from the scenario and save it to a variable. LoadComplete will create the variable to store the extracted data automatically. See Extracting Data From Responses.

Notes:

  • When you enter a name for a new variable, make sure it includes only supported symbols.

    Variable names can consist only of letters (A..Z, a..z), digits (0..9) and underscores ( _ ).

    LoadComplete uses a variable name to refer to it in request parameters, so we recommend that you use a descriptive name that reflects the variable’s role in the scenario, for example, Login, Password, Product, and so on.

  • If a scenario variable and an existing project variable have the same name, LoadComplete will use the scenario variable during simulation (the project variable will be ignored).

Modifying Variables

You can assign values to variables in scenarios by using the Set Variable Value operation:

To assign a new value to a variable
  1. Add a Set Variable Value operation to your scenario.

  2. In the operation editor, select the variable, whose value you want to change, and specify a new variable value.

    You can specify the needed value directly, or you can specify an expression whose value the operation will calculate and assign to the specified variable.

    To learn more, see the operation description.

You can modify properties of project variables in the Variables editor:

To rename a variable in the editor
  • Type the new name for the variable in the Name column of the Variables editor.

LoadComplete does not automatically update variable names in scenarios when you rename variables. After you rename a variable that is already used in one or more scenarios, search through the scenarios and manually update the variable name in them.
To change properties of a variable
  1. Right-click the variable in the Variables editor and select Edit from the context menu.

  2. In the dialog, modify the variable’s properties as needed and click Finish.

Notes:

  • You cannot change the type of existing variables. If you need to change the variable type, delete the existing variable and create a new variable of the desired type with the same name.

  • Excel, CSV and database variables retrieve values from external files. To change values returned by these variables, you need to modify the appropriate files.

After making changes to variables, we recommend that you verify scenarios where these variables are used to make sure that the scenarios remain valid.

Deleting Variables

To delete a project variable:

  • Right-click the variable in the Variables editor and then click Delete.

    Note: If the variable you delete is used in a request parameter, the parameter value becomes the string @variable_name.

    Search for the @variable_name expression to find any occurrences of the variable name in your scenarios and correct them.

To delete a scenario variable:

  • If LoadComplete finds no reference on a scenario variable in your scenario, it deletes the variable automatically.

See Also

About Variables
Types of Project Variables
About Variables Editor

Highlight search results