12
votes

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:

image1image2

1

1 Answers

26
votes

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