Add and use parameters#

You can add the following parameters to a test:

../_images/um_add_parameters.cloud.png

You can click P and select added parameters when editing requests. For more information, see HTTP requests and gRPC requests.

Note

If parameter names from a settings set match the settings of the test, then the test uses the settings from the linked set.

Add a literal parameter#

  1. In the Parameters pane, click literal_button. The window opens:

    ../_images/um_add_parametres_to_test.en.png
  2. Enter the name of the parameter in the Parameter Name field.

  3. Enter the value of the parameter in the Parameter Value field.

  4. Click Save.

Add a CSV parameter#

  1. In the Parameters pane, click csv_button. The window opens:

    ../_images/um_import_csv.en.png
  2. Click to upload CSV file and select the file. The file can contain one or more columns. The file size shouldn’t exceed 50 MB. The page opens:

    ../_images/um_import_parametres_from_csv.en.png
  3. Configure import from CSV file:

    • Field delimiter. The character or string used to separate the fields in the uploaded CSV file, for example “;”.

    • The first line contains parameter’s names. If the toggle is switched on, the first line of the CSV file is used as parameter names. If the toggle is switched off, in the fields Parameter’s name, enter parameter’s names.

    • Reuse values at the end of file. If the toggle is switched on, the CSV file starts rereading from the beginning after having reached its end. If the toggle is switched off, the test run may end earlier than planned when the end of the CSV file is reached.

    • Separate values by threads. If the toggle is switched on, the load generator separates a data set, and each Virtual User instance uses its own data set. If the toggle is switched off, each Virtual User instance uses a common data set.

    • Order. Select one of the values:

      • Random. Shuffles the CSV file lines before executing the test.

      • Sequential. Reads the CSV file lines sequentially.

  4. Click Save.

Use parameters#

You can use parameters as variables in the names of groups, transactions and request URLs. For example:

  1. Add the host literal parameter with the example.com value.

  2. Add a request and specify the https://${host}/ URL:

    ../_images/um_host_example.png

Note

You can also configure URL overwrite when adding a settings set.

The value of the variable will be correctly substituted if:

  • the parameter value doesn’t contain the “/” symbol;

  • in the URL, the value of the variable is escaped by the symbol “/” or the value /path.

Concatenate parameters#

You can concatenate parameters using the template literal ${expression}. For example:

  1. Add the ParamName_${i} literal parameter with value equal to ABC${i}DEF.

  2. Import a CSV file. The file contains values of the i parameter. For example, the i parameter has values 0 and 1.

  3. Run the test.

As a result, PFLB Platform sends 2 requests to the testing system:

  • the first request contains the ParamName_0 parameter with value equal to ABC0DEF.

  • the second request contains the ParamName_1 parameter with value equal to ABC1DEF.