0
votes

I have 1 million records (only 1 column without header) in a CSV/txt file which I am iterating through CSV Data Set Config and stores it a variable. I also have added while controller to check for end of the file to exit the loop and it's also retrying for 5 times before failing any transaction. So I have added the counter of 5.

The problem is, this logic is working but only for 50305 entries in CSV/txt file, it is not continuing till EOF, not sure what is wrong but every time it is exciting in the same way and it goes till 5035.

Could you please help me to loop until end of the file ? Is it happening because I have used groovy for reset the counter?

Added the screenshot.

enter image description here

1
Why are you using While loop to loop till the end. In CSV Data Set Config, select Recycle on EOF as False and/or Stop Thread on EOF as True. This config will run till the end. Please let me know if it works.NaveenKumar Namachivayam
When config is providing one value, it will go till EOF and also updated the config to end the loop when it reaches to end. But I had added the while logic to retry the same HTTP sampler 5 times in case of failure. Basically, i have to read a file, pass the input to HTTP sample and if sampler fails, it has to retry the same HTTP request for max 5 times before marking it fail. If retry succeed in 2nd retry attempt, it should also pass and move forward.anurag kumar

1 Answers

0
votes

I would suggest slightly amend your scenario and have 2 While Controllers, example outline:

  • While Controller, condition: ${__javaScript("${myVar}" != "<EOF>",)}

    • CSV Data Set Config, Variable Names - myVar Recycle on EOF - false, Stop Thread on EOF - false
    • If Controller, condition: "${myVar}" != "<EOF>"
      • Your Sampler
      • If Controller, condition ${JMeterThread.last_sample_ok}"=="false"
      • While Controller, condition ${__javaScript(${counter} < 4 && "${JMeterThread.last_sample_ok}"=="false",)}
        • Counter: Start 1, Increment 1, Reference Name: counter
        • Your Sampler
  • Any other samplers which need to be executed after main 1 million "while" loop

References: