0
votes

I have to make a GET call on IDs stored in a CSV while and I have to retry on GET call till it returns 200 response code. This is what my current structure looks like ..

GET thread group

  • Once only controller to grab authentication for each thread

  • While Controller with condition "${__javaScript("${index}"!="<"EOF">")}" to check for end of the CSV file

    • CSV data config file (Each file is unique for each thread) , variable name is "index", Recycle on EOF - False, Stop thread on EOF - True, sharing mode - current thread

    • While Controller with condition "${__javaScript(parseInt(vars.get("Response_code"))!=201)}"

      • User defined variables - Response_code

      • Http GET request

      • JSR233 post processor - "vars.put("Response_code",prev.getResponseCode());"

      • JSR223 post-processor - To write ID returned in successful call to another CSV file

Now I am not getting error or anything .. but I was expecting first while controller to loop through CSV file for each id, then make a GET request for each id and then second while loop would wait for success code but for some reason, GET call is only executing for the first entry in the csv and then exit out of it. What am I missing here?

1

1 Answers

0
votes

CSV data config file (Each file is unique for each thread)

this is not how it works, the CSV Data Set Config is being initialized once with the filename resolved at the time of its execution, it doesn't load the new CSV file for each virtual user.

If you're looking for an option of supplying the CSV file name(s) dynamically in the runtime - consider switching to __CSVRead() function. See How to Pick Different CSV Files at JMeter Runtime article for more details.