To execute load test scenarios created with context parameters, we use CSV files as an external source that stores the parameters’ values (Uploading Dynamic Variables (Context Parameters) to the Test Scenario). You can make your load test more realistic by configuring usage of value rows from the uploaded CSV file. To do this, go to the Test Scenario page in the Context Parameters section and configure the Value Rows Range and Row Use options.
Setting Value Rows Range
By default, all value rows from the uploaded CSV file will be used in the test. However, in the Value Rows Range field, you can explicitly specify the range you want to select values from. The first row in the CSV file that contains context parameters values is considered the first value row. The row with parameters names is not counted.
Setting the Row Use Mode
In the Row Use field, you can specify how the value rows from the CSV file will be accessed in the test.
- By default, the Not Unique mode is used and the rows are accessed in a random order.
- Generally, when your web application does not allow to use the same data concurrently (e.g., concurrent login is not supported), it is recommended to use the Unique per User mode.
- In the case when it is necessary to load test with unique users using unique data (e.g., to login each time under a new username), it is recommended to use the Unique per Session mode.
For example, let’s consider a basic load test. The execution plan presented in the picture below has a 2-minute device duration (the time it takes for a single user to execute a test session).
Next, let’s take a closer look at the Row Use mode and how the system uses a CSV file to execute the described test in each mode.
By default, the system selects and passes a random value to a virtual user every time a virtual user starts a test session. In this case, values from a single row can be used concurrently by different users (see the “Row 4” on the image below) and more then once by the same (see the “Row 1” below) or different virtual users during a test run.
If you set the range of rows to one row, all test sessions will be executed using values from the same row during a test run. For example, all virtual users will use the same username to execute sign-up transactions or the same keyword to run through search transactions.
Unique per Session
In the Unique per Session mode, the system uses a unique value row per test session. Therefore, each value row will be used just once during the test run.
Note that when the Unique per Session mode is selected, the number of sessions in the test will be automatically limited to the number of the value rows in the uploaded CSV file or to the Value Rows Range, if specified (see the Limiting the Number of Test Sessions article).
Unique per User
In the Unique per User mode, the system uses values from a unique row only with one virtual user during a test run. Note that in this mode, the number of virtual users will be limited to the number of value rows in the CSV file or to the Value Rows Range if specified.