This topic explains how you create, modify and delete variables in LoadComplete.
To create a project variable:
In the Variables editor, click New Variable on the editor’s toolbar.
LoadComplete will open the Variable wizard.
Follow the wizard instructions to create a variable that accesses the needed data.
– or –
On the Select Variable page of the Parameterization wizard, select New variable and enter the variable name.
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
Open your scenario in the Scenario editor.
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.
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).
You can assign values to variables in scenarios by using the Set Variable Value operation:
Add a Set Variable Value operation to your scenario.
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:
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.|
Right-click the variable in the Variables editor and select Edit from the context menu.
In the dialog, modify the variable’s properties as needed and click Finish.
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.
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
Search for the
To delete a scenario variable:
If LoadComplete finds no reference on a scenario variable in your scenario, it deletes the variable automatically.