0
votes

When i use a loop controller to go through my results from regex extractor, it stops working when i include a http request inside the loop controller.

Regex extractor format (will output multiple results with multiple groups each)

name of created variable - pageDetails
Template: blank
Match no -1

After that i initialized a loop controller (with a counter) to go through all the results of this regex

enter image description here

The counter is as follows

   Starting value =1
    Increment =1
    Maximum value =${pageDetails_matchNr}
    Reference Name =pageDetailsIndex

I have a debug sampler in the loop thats using the counter

${__evalVar(pageDetails_${pageDetailsIndex}_g1)}  ${__evalVar(pageDetails_${pageDetailsIndex}_g2)}

Also have http request in the loop thats using the counter enter image description here

If i disable the httprequest in the loop controller, the debug sampler works, and prints out all the values

However, if i enable the http request, BOTH the debug sampler and http request only work in the first iteration works i.e. when ${pageDetailsIndex} = 1. When its above 1 then ${__evalVar(pageDetails_${pageDetailsIndex}_g1)} etc. all return blanks...

1

1 Answers

1
votes

Most probably your Regular Expression Extractor scope is not correct, if you want to apply it to one Sampler only - you need to make it a child of that particular sampler

From your explanation it seems that the HTTP Request sampler which is under the Loop Controller is overwriting the previous values which should not be the case.

Also be aware that your Counter is not necessary, there is ${__jm__Loop Controller__idx} special JMeter Variable which holds the value of the current iteration of the Loop Controller.