%% Last Updated: - [[2021-04-19]] %% [[Test Data]] in [[Gatling]] can be added to a script to [[Making load testing scripts more realistic|make it more realistic]]. First, the data file must be created. Here is an example of the contents of `users.csv`: ``` username,password user1,pass1 user2,pass2 user3,pass3 user4,pass4 ``` In order for Gatling to recognise it, it will need to be in a particular folder. The default path for this folder can be viewed or changed in `/conf/gatling.conf`: `# data = user-files/data # Directory where data, such as feeder files and request bodies are located (for bundle packaging only) ` It’s worth it to check this as some later versions of Gatling may use `user-files/resources` instead. Assuming you have this set as above, create a data folder under `user-files`. Then transfer the CSV file into `/user-files/data`. In Gatling, you’ll need to first set up what’s called a feeder, which is basically a way to get data from a file and bring that data into the script: `val csvFeeder = csv("users.csv").circular` Note that this line is for CSV files particularly, although there are [other types of feeders](https://gatling.io/docs/2.2/session/feeder/#feeder) that you can use with Gatling. If your users.csv is not in the default data directory, you will need to include the filepath. For example, when running this on Flood you’ll need to change this line to: `val csvFeeder = csv(“/data/flood/files/user-files/data/users.csv").circular` But for now, since we’re just running this locally, you can leave it as is. The circular at the end of the line tells Gatling that when the script runs out data to consume (such as when you have five users and only four lines of data), it should go back to the beginning and re-use the same data. Now, to use the data, you’ll need to refer to it by the headers on the data file itself. In our case, it’s username and password, so here’s how we could use that data to pull in a line of values into a post request: ```scala .feed(csvFeeder) .exec(http("02_Login") .post("/login?username=${username}&password=${password}") ) ```