How to configure random variables in JMeter?
To set up random variables in JMeter, follow these steps:
- Open JMeter and create a thread group.
- Create a random variable configuration element under the thread group. Right-click on the thread group, select “Add” -> “Config Element” -> “Random Variable”.
- Enter the variable name in the “Name” field, for example, “myVariable”.
- Input the minimum value of the random number in the “Minimum Value” field and the maximum value in the “Maximum Value” field.
- Optionally, you can choose “true” in the “Per Thread” field to have each thread use its own random number generator.
- Save and execute the test plan, random variables will be created and used during the test execution.
You can use this random variable in your test plan to simulate different random values, for example using ${myVariable} in an HTTP request to represent a random value.