%%
Last Updated:
- [[2021-04-19]]
%%
The CSV data set config in [[JMeter]] is an element used to import a `.csv` file as [[Test Data]] for the [[Load Testing]] script.
## Create the CSV file
Create a CSV file that looks like this:
```
username,password
user1,pass1
user2,pass2
user3,pass3
user4,pass4
```
## Adding the config element
Click on the Test Plan element > Add > Config Element > CSV Data Set Config. Then click on the newly created element. The only thing you’ll need to change is the filename to include the path to the CSV file you’ve just created.

If you don’t put anything in the “Variable Names (comma-delimited)” field, JMeter will by default use the first line of the CSV file as the variable names.
Then go to the request where you want to use those values and replace the hardcoded values with the variables you want to use— in this case, `${username}` and `${password}`. Note that you wouldn’t really pass these in the clear like this in your application; this is just a simple example to get you started.

When you run your script, you can confirm whether the request has picked up these values by clicking on the View Results Tree listener, clicking on the HTTP request and clicking the Request tab. You can see below that the script has automatically used the values from the first line of our users.csv file.

If you have a lot of test data that you’re using this way, one way to see at a glance what the current values are is to add a Debug PostProcessor by clicking on the sampler (HTTP Request) > Add > post Processors > Debug PostProcessor. Next time that you run your test, you can click on this post processor and go to the Response data. It will have all the current values of the variables you’re using. This can be a great way to debug between multiple iterations. Just remember to disable this while you’re running your full-scale load test.
