Is it possible to limit maximum value with ${varible}
in the Random variable?
Or limit the maximum value in Random variable with other variable?
Answer: To handle JMeter dynamic values two steps need to be performed i.e. one to get and store the dynamic value from the response and second to use that value in the successive request. This is done using the Regular expression extractor post-processor.
Using the Random function In this method, you need to define JMeter's random function and pass min, max and variable name (optional) as a value of Match No. field. The random function generates a random value within the specified range and passes into the Match No.
The __Random function will give you an index for your interval. To obtain values from 1 to 5, you have to call __Random(1,6,) , as it will never reach the MAX value. The __V function, will obtain the value of the variable with the given name.
You'll have to write a BSH post-processor to give a dynamic value for Maximum Value.
This link has an example.
I had a similar problem and __Random
function helped me.
I've used it as a value for a HTTTP request that way:
${__Random(min,${variable})}
So I have random value with variable maximum for each thread.
Here is the screenshot.
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