- Created by SS Doc Editor, last modified on Feb 17, 2025

A Data Generator (DG) dynamically generates random or systematic values during test execution. These values are assigned to variables with the same name used for parameterizing requests. DGs enable the creation of streams of emulated business data of various types, which can be incorporated into the HTTP load stream.
Using dynamically generated data enhances test realism by mimicking real-world user interactions with a web application. Additionally, it eliminates the need to manually create large test datasets.
Data Generator Types
A DG type determines the nature of the generated values. The available types include:
- Integer: Generates random or sequential integer values.
- Double: Produces floating-point numbers within a specified range.
- Date/Time: Returns timestamps in various formats.
- Text: Returns the text of the following types:
- Ai-synthetic-data
- Random sequence
- Constant
- GUID: Generates unique identifiers (UUIDs).
Constant - Returns a constant text defined in the Constant Text property.
Note
Use the Constant data generator with other source variables to add a constant prefix or suffix to dynamic data.
By leveraging data generators, performance tests can simulate dynamic and realistic user behavior, improving test accuracy and efficiency.
How to create a DG
- Select the Data Generators node on the Test Workflow Tree.
- Click Create a New Data Generator to bring up the generator dialog.
- Select the DG type that will return the appropriate data type.
- Use the When To Evaluate property to control when the data generator creates new values.
- On-iteration:
- One value per test iteration
- Reuses value across all parameters
Example
Email Verification for forms requiring repeated email entry.
- On-request:
- New value for each parameter use
- Independent values every time
- On-read:
- New value per iteration
- Per recorded value replacement
Tip: Evaluate on read
Set the When To Evaluate property to On-read to generate a new random value to replace every unique recorded value. However, the same data generator value on a single VU-Iteration will replace two identical recorded values.
For example, if you parameterize 4 recorded values "aaa", "bbb", "ccc" and "aaa" in your test case, then you can get corresponding data generator values "123", "456", "789", "123" on-iteration 1 and 987", "654", "321", "987" on-iteration 2. Note that the 1st and the 4th random values are the same (within one VU-iteration) because the 1st and the 4th recorded values are the same.
An alternative way to create the same type of parameterization is to create 3 data generators with the When To Evaluate property set to On-iteration: DG_aaa to parameterize 1st and 4th the recorded value, DG_bbb parameterize 2nd recorded value, and DG_ccc to parameterize 3rd recorded value.
However, n-iteration substantially simplifies parameterization since you can use a single data generator. It's beneficial when you need to parameterize multiple recorded values.
DGs within loops
When a data generator with the When To Evaluate property set to On-iteration or On-read is inside a loop object like Loop or Do...While with the Increment the index for iteration-bound datasets property is set to yes, a new value is generated on every loop iteration.
- On-iteration:
5. Configure the remaining properties and give them a unique name. It will appear in the Variable Picker when you create parameters. Use the Format String property to format the generator output.
6. Click Verify to test the return value.
7. Click Save & Close.
8. Click Clone Generator to make multiple copies.

When the DG is used to parameterize a request, it is referred to by its name surrounded by the brackets, for example: {{MyRndInteger}}.
When the Variable Picker is used to create a parameter, a properly formatted DG name reference is inserted automatically.
Concatenation Expression Parameters
Data generators can create parameters based on expressions of two constant substrings with a random value between them. In Concatenate Expression property, enter "{0}" surrounded by prefix and suffix substrings.
For example, if a data generator Is configured to generate a random integer between 0-100, and its Concatenate Expression property Is set to id ="{0}", then such data generator will render values like id="72" or id ="31".

- No labels



