Ahmet Erden
Ahmet Erden

Reputation: 75

JMeter - Variable is resetting in each loop (Regular Expression Extractor)

I have a Test Plan like this:

My Test Plan in JMeter

As you can see, I have a myarray variable to get all the matches in the Loop Controller. In each loop myarray variable resets its content so I only get the last loop's myarray content to process in ForEach Controller. How can I add each loop's myarray content to over each other.

Upvotes: 2

Views: 774

Answers (1)

Naveen Kumar R B
Naveen Kumar R B

Reputation: 6398

Add ${__counter(,)} to the existing Reference Name in Regular Expression Extractor.

Example:

Reference name: myarray_${__counter(,)}

so, for each loop new reference name will be used and hence previous iterations results will be saved.

first loop results: myarray_1 second loop results: myarray_2 etc.

Upvotes: 1

Related Questions