1
votes

my JMeter plan is

-- Loop controller (set to 3)
  -- while controller(set to "${Dataitems}" != "<EOF>")
    -- using CSV for  reading the data items
    -- HTTP requests

now issue is that after completing the while loop , thread is getting stopped . I know this is controlled in CSV config "Stop thread on EOF" =true will make thread to stop. But my requirement is that after iterating through my csv , I want control to passed to outer loop which will run based on the variable i provide in my case 3 so all request will run for all the data items i provide in csv for three times.

To achieve i tried to set

  1. "Stop thread on EOF" = false , then its started running lopp for intinte times
  2. "Stop thread on EOF" = ${Var1} , where var1 was declared in test plan , but still loop was running infinite times

Can some provide an insight on how to handover control from while loop to outer loop?

Your help much appreciated.

1

1 Answers

1
votes

As you know, While controller will keep running until the condition fails.

Unfortunately, in your case, you need to set below condition to reiterate the CSV file values.

'Recycle on EOF?' to TRUE

So, While controller will never exit as you can not use any condition there (to fulfill your requirement).

The only way I can think to make your requirement work is - to use 2 Loop Controllers.

(Outer) Loop Controller (set to 3 as you had said)

(Inner) Loop Controller (set to no of rows in CSV)

I get the output like this. My CSV file has 3 rows with the values A,B,C. They are called 3 times by the outer loop controller.

enter image description here

If you do not want to hard code the number in the loop controller, use a variable & find the no of rows using beanshell and set the value to the variable.