CSV data config always reads from first row. I want to add column headers in the CSV file. Hence I want the CSV config to start reading from second row.
Below is the setting in Thread Group. No.of threads = 1 Loop Count= 10 (depends on no.of rows in CSV file)
The “CSV Data Set Config” enables using CSV files as an external data source, where you can keep unique user data like names, emails and passwords. With the help of this config element, JMeter is able to read the CSV file line by line, and then use split parameters to allocate different values for different threads.
Now, the function __CSVRead will take the data from the CSV with the same name of the user we use for the login. This way we can use different CSVs and pick them correctly at runtime. This is the complete flow: In each execution, the "CSV Data Set Config" picks a new user and pass from the users.
Because the CSV Data Set Config is used to read lines from a file, and split them into variables, and is exactly what we need to be able to generate this data-driven tests. Inside the CSV Data Set Config there are few fields you need to configure in order to run Apache JMeter tests and load the data for the test from a CSV file.
Apache JMeter has an element that allows you to use external test data sets in a CSV or txt format. That element is called ‘CSV Data Set Config’.
Note: JMeter supports CSV header lines: if the variable name field empty, then the first line of the file is read and interpreted as the list of column names. Next step is to choose the delimiter, we found out that the easiest to use is the comma delimiter, so in our CSV file we’ll separate the key,value pairs with a comma as below:
Why do we need a CSV Data Set Config config element? Because the CSV Data Set Config is used to read lines from a file, and split them into variables, and is exactly what we need to be able to generate this data-driven tests.
In csv file add header. Header values will act as variable names which could be used as parameters in requests. ~sample facility.csv file facility1,name GG1LMD,test1
Request
What version of JMeter are you using? It seems like leaving the Variable Names
field empty will do the trick. More info here:
Versions of JMeter after 2.3.4 support CSV files which have a header line defining the column names. To enable this, leave the "Variable Names" field empty. The correct delimiter must be provided.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With