Create parameters
This topic describes how to create parameters for your VuGen script.
Note: To create parameters for DevWeb scripts, see Parameters for DevWeb.
Create a parameter
-
Select the value you want to parameterize.
Pane Do this Editor pane Select the value you want to parameterize, right-click, and select Replace with Parameter.
Note:
-
When creating XML parameters in script view, you must select only the inner xml, without the bounding tags. For example, to parameterize the complex data structure <A><B>Belement</B><C>Celement</C></A>, select the whole string, <B>Belement</B><C>Celement</C>, and replace it with a parameter.
-
When parameterizing Java Record Replay or Java Vuser scripts, you must parameterize complete values, not parts of a value.
Step Navigator pane Right-click a step and select Show Arguments. Click the ABC icon next to the argument that you want to parameterize. -
-
Create a new parameter in the Select or Create Parameter dialog box.
For user interface details, see Select or Create Parameter dialog box.
-
Add a list of values.
-
From the Select or Create Parameter dialog box, select Properties.
-
Create a table and add entries to serve as the list of values for your parameter.
-
Optionally click Import Values to retrieve parameter values from a file.
For user interface details, see Parameter Properties dialog box.
-
-
Modify the parameter delimiters. (Optional)
- Open the Parameter Delimiters Configuration dialog box:
-
In the Solution Explorer pane, right-click the Parameters node and select Configure Parameter Delimiters.
-
Design > Parameters > Configure Parameter Delimiters
- Tools > Options > Scripting > Parameters
- Modify the delimiters that surround parameters.
For user interface details, see Parameter Delimiters Configuration dialog box.
- To view the substitution in the log during replay, open Runtime Settings > Log. Under Extended log level, enable Parameter substitution.
- You can see the results in the Output window or in the test results, by navigating to Replay > Test Results.
Create parameter example
The following example replaces the first name value entered into a form, with a parameter, so that it can be fetched from a list of values.
-
The hardcoded value is selected in the script code.
-
A parameter is created from the right-click menu option: Replace with Parameter > Create New Parameter. The Select or Create Parameter dialog box opens.
-
The parameter is assigned a name and type: First_Name and File.
-
The Properties button is clicked, and it opened the Parameter Properties dialog box.
-
The Create Table button adds a table, and several rows were added manually to the First_Name column. The Add Row button adds rows to the table, and assigns different values. An update method was assigned: Sequential and Each iteration.
-
The Runtime Settings Log option was set to capture Parameter substitution.
-
The Output window and log file show the parameter substitution. In the third iteration of the script, it substituted the third value of the First_Name parameter, Bob.
Action.c (41): Notify: Parameter Substitution: parameter "First_Name" = "Bob"