trying to pass the value (which is extracted from json path extractor) to the next http request

40 Views Asked by At

I have extracted 10 values from a Json path extractor, naming device_1,device_2,device_3 to device_10. I am able to see these 10 values in debug sampler and now i want to pass on these value to the next http request one by one (may be by using a loop) but i am not able to find any way where i can pass all these 10 values one by one to next http request. As of now i am sending only 1st value as ${device_1} in the http request but i want 10 different users to access all 10 values one by one.

1

There are 1 best solutions below

1
Dmitri T On

I believe ForEach Controller is something you're looking for.

Configure it like:

enter image description here

and use ${device} in the HTTP Request sampler which is inside the ForEach Controller.

enter image description here

The HTTP Request will be executed as many times as there are matches generated by the JSON Extractor.

enter image description here

The similar concept is described in Using Regular Expressions in JMeter article