JMeter: extracting data from CSV file

By: Slav Kurochkin

Dealing with repetitive data in JMeter, can be annoying if you don’t have ability to manipulate the data. Using CSV file as a data provider saving lots of time and giving that data manipulation power.

First lets place csv file with data in same folder where your .jmx file saved.

Add CSV file to Thread Group, right click on Thread Group => Add => Config Element => CSV Data Set Config

Firest row in your CSV can be used as Variable Names, so it will pickup variable names, and start iterating from the second row. In that case you don’t need to specify Variable Names in your CSV Data Set Config, the only thing you would need to do is specify value for data parameter in HTTP Request.

Here is how your CSV file might look:

As I mentioned early you can provide Variable Names in CSV Data Set Config, you would just type comma separated names.

After all add name values, basically open your HTTP request and add the following code ${variable_name} next to the name. And that is it now you can run the tests which will extract data and provide it as a variable from CSV file.

View Comments

Leave a Comment

Use markdown or basic HTML and be nice.