Skip to content

__Random

JMeter __Random function reference: syntax, parameters, and practical examples for parameterizing test plans with dynamic values.

Difficulty
intermediate
Guide type
reference
Estimated read time
1 min read
Last verified version
Verified JMeter 5.6

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.

NameRequiredDescription
Minimum valueYesA number
Maximum valueYesA bigger number
Variable NameNoA reference name for reusing the value computed by this function.

Examples:

Terminal window
\${__Random(0,10)}

will return a random number between 0 and 10

Terminal window
\${__Random(0,10, MYVAR)}

will return a random number between 0 and 10 and store it in MYVAR. \${MYVAR} will contain the random number

${__Random(0,10)} โ†’ a random number between 0 and 10
${__Random(1000,9999,pin)} โ†’ stored in variable "pin" too

For weighted or larger datasets, a CSV Data Set Config usually models real traffic more accurately than a uniform random range.

On this page