Reputation: 137
I am reading parameters from csv file and with While loop running through the list. Inside my test plan I am reading the output with JSON Path Extraction. One of the parameters is saying there are 7 items (DeedIDs_matchNr=7) and then I am adding the loop to call each one of the parameters with Counter and ID for a specific call.
. This works as you can see above. I got 7 items and it created 7 calls. Move next to next item in csv. This item has DeedIDs_matchNr=0 so it doesn’t enter the loop and moves forward.
In the next item DeedIDs_matchNr=2, but it doesn’t enter the loop.
It looks it hold the previous DeedIDs_matchNr=0 somehow in memory and doesn’t reads the real parameter correctly. Loopcontroler config:
Any ideas and work around? See screenshots.
Upvotes: 1
Views: 156
Reputation: 58822
You shouldn't use Loop controller to loop through array of variables, there's a dedicated controller - the ForEach controller:
A ForEach controller loops through the values of a set of related variables. When you add samplers (or controllers) to a ForEach controller, every sample (or controller) is executed one or more times, where during every loop the variable has a new value.
After the introduction, just put in Input variable prefix
field DeedIDs
and in Output variable
field write variable name as currentDeedID
and use it inside loop to get current value ${currentDeedID}
Upvotes: 3