Generate 'Random number' variables in JMeter

xGIx picture xGIx · Jul 26, 2017 · Viewed 11.8k times · Source

Is it possible to generate 'Random number' variables in JMeter?

  1. I have recorded a user journey
  2. I have imported the journey into JMeter
  3. I have to type in a unique 4digit id within my user journey test case
  4. Its default to 2323 at the moment in jmeter

Is there a way of generating a random 4didgit number? For example thread1: ID: 2323 thread2: 3334 thread3: 5643

Please refer to images below:

image1 image2

Answer

user7294900 picture user7294900 · Jul 26, 2017

Use Random JMeter function

${__Random(0000,9999)}

The random function returns a random number that lies between the given min and max values.

  • Third parameter can be used as a variable name to save random value