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:
If you want to use the current iteration counter you need to wrap everything into
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