ShiyamTJ
ShiyamTJ

Reputation: 786

What are the available value(s) for "seed for Randome Function" used in JMeter for Random Variable config Element

Need to know what are the available value(s) for "seed for Random Function" used in JMeter for Random Variable config Element. (It would be better with examples)

Upvotes: 0

Views: 5178

Answers (2)

und3rh00ds
und3rh00ds

Reputation: 11

As other answers already mentioned, seed is a value which is used as initial value for generating the random numbers. Mathematically speaking, the formula for generating random number is: Xn+1 ​= (a⋅Xn + c)mod m where Xn+1 is the random number generated and X0 is the seed value. Now coming back to your question, we can use any seed value here e.g.123. There are some other seed functions that we can use in jmeter are -

  1. ${__time} - this the default seed value. Current time in milliseconds is used as the seed value.
  2. ${__threadNum} - the thread number is used as the seed value

For more information on jmeter functions, you can check its official documentation Jmeter documentation on functions.

Upvotes: 0

Erik Schierboom
Erik Schierboom

Reputation: 16656

A seed is a value used to generate random output on. As a random number function is really just a function, the "random" value being output is always based on the seed. In other words, if you seed the random output generator with the same seed value, you will get the same "random" result. This is why most random number generators use the system time to seed themselves, as that is highly variable.

Now back to your question. If you specify a seed, you will get fixed random output. This makes it easy for you to repeat the test with the exact same random values, just pass in the same seed.

Upvotes: 1

Related Questions