12
Feb

Loop through all rows of test data file in JMeter

If you have a test data file (in CSV / txt format) and need to execute all rows of test data in your JMeter plan. Following steps can be followed to achieve same:

Step 1. Define your test data file in csv / txt format.
eg. variable1,variable2….
Step 2. Define an while controller with the Condition as ${variable1}
Step 3. Define a child CSV Data Set Config, with the file path and all the variable names (eg. variable1, variable2….)
Step 3a. Configure CSV Data set with following settings:
1. To stop execution after the end of the CSV file is reached:
Recycle on EOF? = False and
Stop thread on EOF? = True.
Step 4. Use the ${variable1} to fire the JMeter request.

Thread Group
|-> While Controller (Condition=${variable1})
|-> CSV Data Set Config
|-> HTTP Header Manager
|-> HTTP Request
|-> Response Assertion
|-> View Results Tree