Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jmeter dynamic random variable

Tags:

java

jmeter

Is it possible to limit maximum value with ${varible} in the Random variable?
Or limit the maximum value in Random variable with other variable?

like image 731
Ballon Avatar asked Aug 17 '10 12:08

Ballon


People also ask

How does JMeter handle dynamic values?

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.

How can we pass random values from the selected values in JMeter?

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.

How do you select a random value from an array in JMeter?

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.


2 Answers

You'll have to write a BSH post-processor to give a dynamic value for Maximum Value.

This link has an example.

like image 55
JoseK Avatar answered Nov 02 '22 07:11

JoseK


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.

like image 32
horst14 Avatar answered Nov 02 '22 06:11

horst14