15

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

Ori Marko
  • 56,308
  • 23
  • 131
  • 233
xGIx
  • 509
  • 3
  • 7
  • 26

1 Answers1

41

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
Community
  • 1
  • 1
Ori Marko
  • 56,308
  • 23
  • 131
  • 233
  • thanks so much for your help, do i just add it to the 'value' textfield, listed in the image? – xGIx Jul 26 '17 at 13:47