0
votes

The problem I'm trying to solve is how to go about randomizing HTTP requests with multiple available values of parameters one would manually select via a drop-down list. I'm doing this in JMeter so AFAIK I cannot just declare an array containing values of parameters that said drop-down list options refer to and then use random indices for values. For the sake of simplifying the problem - let's say I'm writing a test plan where a thread searches for a book title in an e-bookstore and goes to 'view' a found item. I want to start a buch of threads but don't want them all to search for the same book. I do know all titles available but do not know how to make each thread search for a different one. I could try defining a varable per value and use __RandomFromMultipleVar() with all variables as its parameters but that would be quite a chunky piece of code if I wanted to select from more than just a few values. If there's a way of defining multivalue variables, it would realy come in handy.

1
How about creating a csv file with all the values that you would like to use, and then make the threads read those values from the csv file? Each thread will read a different value.ararar
RW file operations are costly, though. Once I run 100 or even 1000 threads at once, the tests will take loooong if I do that.SpriteYagami
I'm not sure if i understand what you mentioned in your post correctly. So you have for example 100 keyword and you want each thread to search for a different keyword, if that is the requirement, then all you need to do is to configure a csv file with all the keywords you have, each one in a separate row and read from the file.ararar

1 Answers

0
votes

You can add User defined Variables under Http Request with name and value Example: Name= option_1;option_2; option_3 and different Values for each option. User Defined Values Example

In Http request body add below code in place where you enter value.

"${__V(option_${__Random(1,3,)})}"