user3834163
user3834163

Reputation: 137

JMeter doesn't refresh parameters if the previous was 0

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) enter image description hereand then I am adding the loop to call each one of the parameters with Counter and ID for a specific call. enter image description here. 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. enter image description hereIn the next item DeedIDs_matchNr=2, but it doesn’t enter the loop.enter image description here It looks it hold the previous DeedIDs_matchNr=0 somehow in memory and doesn’t reads the real parameter correctly. Loopcontroler config: enter image description hereAny ideas and work around? See screenshots.

Upvotes: 1

Views: 156

Answers (1)

Ori Marko
Ori Marko

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

Related Questions