I've got some user defined variables to which I allocate a random number using:
${__Random(1,100)}
I then run my test using 1 thread for 5 iterations. JMeter generates the same random number for each iteration.
How do I generate a new random number for each iteration?
User Defined Variables is a configuration element which means that:
So just use this __Random() function directly where required.

If you need to re-use the value in more than one place - amend your function call like:
${__Random(1,100,myValue)}
and after that declaration you will be able to refer random generated value as ${myValue}

Add as first step of Thread Group a Flow Control Action
Put inside it a pre processor called User Parameters and click Add Variable
And put in it what you currently have in User Defined Variable

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With