How to Use CSV Config in JMeter: JMeter is an open source tool used to do performance testing by simulating virtual users,  we need to pass data dynamic data like (user logins, searching orders, canceling orders, etc) to test how humans will do in general.

In Jmeter to send realistic data during execution, we can use “CSV Data Set Config” which is one of the features which comes inbuilt with the JMeter tool.

How CSV Data Set will work?

You have defined a CSV data set in your script when the test starts JMeter will read the content from the file and send each row for each thread.

Let’s say we are using 10 users for testing if you have 8 users in the CSV file, the CSV Data set has the option to re-use data once it read EOF, if you want to stop the thread on the EOF file still we can do it

Maintaining unique data through your test is not possible with the default CSV data set, For that we have to use a different plugin.

In CSV data sets currently don’t have the option to update the value on each occurrence like load runner and it will not support randomizing the test data.

 How to use CSV Data Set Config?

We can add CSV data set to the Test plan or Thread Group, if you add CSV config at the test level it will accessible for all thread groups if you declare at the thread group level data will be used by only the thread that we added.

Also Read: Size Assertion in JMeter

how to add csv data set config

CSV Data Set Config

CSV Data set have Multiple Fields:

  • Filename: we need to give the complete path including file name with extension if script and CSV file both are not in the same folder or not in the JMeter\bin folder. if your script and CSV file are the same folders then we can give only the file name with its extension. we give file extension .csv, .txt.
  • File Encoding: it’s not mandatory to give encoding, possible values are UTF-8, UTF-16, etc.. we can use them as per our requirements. it supports all file encodings which java supports
  •  Variable Names: it is also not mandatory if you are already given the variable names in a CSV file, we can give multiple variable names with commas as a delimiter, but columns should match with your CSV to avoid confusion
  • Ignore the first line: if you already added variables names in the CSV file then you can make variables names empty and keep ignoring the first line as true
  • Delimiter: here we need to mention what is the demister we have used in the input file like comma, tab, or any other symbol
  • Allow Quoted Data: make it true if your CSV file has quoted date in CSV like this “hello world”,”hi world”
  • Recycle on EOF: if we want to re-use data once it completes all data
  • Stop thread on EOF: if you want to stop the test on test data completes we should make it true
  • Sharing mode: By default, All threads are selected

Hope it helps you.

How to Use CSV Config in JMeter

Leave a Reply

Your email address will not be published. Required fields are marked *