JMeter __Random function reference: syntax, parameters, and practical examples for parameterizing test plans with dynamic values.
Also documented in context in the full Functions and Variables reference.
TL;DR: __Random returns a random integer between a min and max value โ the simplest way to add variety to a request (random product ID, random delay, random page number) without a CSV file.
The random function returns a random number that lies between the given min and max values.
| Name | Required | Description |
|---|---|---|
| Minimum value | Yes | A number |
| Maximum value | Yes | A bigger number |
| Variable Name | No | A reference name for reusing the value computed by this function. |
Examples:
\${__Random(0,10)}will return a random number between 0 and 10
\${__Random(0,10, MYVAR)}will return a random number between 0 and 10 and store it in MYVAR. \${MYVAR} will contain the random number
Example
Section titled โExampleโ${__Random(0,10)} โ a random number between 0 and 10${__Random(1000,9999,pin)} โ stored in variable "pin" tooFor weighted or larger datasets, a CSV Data Set Config usually models real traffic more accurately than a uniform random range.