Home > Back-end >  How to automatically loop multiple Ids in Jmeter
How to automatically loop multiple Ids in Jmeter

Time:05-31

I am now trying to use Jmeter.

I have created a http request to receive multiple Ids from one response and used Json extractor to store the Ids.

The stored Ids are like: id_1:1234 id_2:2234 id_3:3234 id_ALL:1234,2234,3234

Now, I would like to use those Ids in another response, but I don't want to configure the variable every time because there are numbers of id_{ascending number}.

example:

url: http://localhost/{id_1} method: GET

url: http://localhost/{id_2} method: GET

url: http://localhost/{id_3} method: GET

I have tried to use User defined variable like: ${id_${counter}}, but it didn't work. How do I get this operation successfully?

Thanks very much.

CodePudding user response:

The easiest is using enter image description here

If you want to use the current iteration counter you need to wrap everything into enter image description here

String representation just in case:

${__V(id_${__intSum(${__jm__Loop Controller__idx},1,)},)}

More information: Here’s What to Do to Combine Multiple JMeter Variables

  • Related