I have a Thread that does an http POST, each time giving back a response with a unique ID. I have a while controller setup with a counter, a json extractor everything seems great until my json extractor variable keeps getting overwritten by the previous POST.
i took the while controller setup code straight from the website below https://octoperf.com/blog/2017/11/30/how-to-use-jmeter-while-controller/
I have it set to run 5 times which it does, but my Unique ID gets overwritten
-Thread
- JSR223 Name: initCounter
vars.put("counter","1");
- While Controller counter less than or equal to 5
- HTTP Request
- JSON Extractor
names of create variables: Id
JSON Path Expressions: Id
Match No. (0 for Random): -1
- JSR223 Name: incrementCounter
int counter = Integer.parseInt(vars.get("counter")) +1;
vars.put("counter",Integer.toString(counter));
Debug Sampler:
accountId_matchNr=1
counter=2```
```accountId_1=b39c34cd-aa44-452f-8e2c-d123123123
accountId_matchNr=1
counter=3```
```accountId_1=b39c34cd-aa44-452f-8e2c-dsfssdfdfs
accountId_matchNr=1
counter=4```
```accountId_1=b39c34cd-aa44-452f-8e2c-235534
accountId_matchNr=1
counter=5```
```accountId_1=bfc0a3c3-5eab-443c-bd44-dfgdgdfg
accountId_matchNr=1
counter=6```
How I can get variables for each and every accountId_1 (Eg: accountId_1 accountId_2 accountId_3 etc etc)
So each time it hits the POST i store the Id in var1 var2 var3 etc etc
images of my IDE setup:
[1]: https://i.stack.imgur.com/XGUgV.png
[2]: https://i.stack.imgur.com/RWv64.png