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

  1. 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.
  2. Create a new parameter in the Select or Create Parameter dialog box.

    For user interface details, see Select or Create Parameter dialog box.

  3. Add a list of values.

    1. From the Select or Create Parameter dialog box, select Properties.

    2. Create a table and add entries to serve as the list of values for your parameter.

    3. Optionally click Import Values to retrieve parameter values from a file.

    For user interface details, see Parameter Properties dialog box.

  4. Modify the parameter delimiters. (Optional)

    1. 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
    2. Modify the delimiters that surround parameters.

    For user interface details, see Parameter Delimiters Configuration dialog box.

  5. To view the substitution in the log during replay, open Runtime Settings > Log. Under Extended log level, enable Parameter substitution.
  6. You can see the results in the Output window or in the test results, by navigating to Replay > Test Results.

Back to top

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.

  1. The hardcoded value is selected in the script code.

  2. A parameter is created from the right-click menu option: Replace with Parameter > Create New Parameter. The Select or Create Parameter dialog box opens.

  3. The parameter is assigned a name and type: First_Name and File.

  4. The Properties button is clicked, and it opened the Parameter Properties dialog box.

  5. 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.

  6. The Runtime Settings Log option was set to capture Parameter substitution.

  7. 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"

Back to top