Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to start reading from second row using CSV data config element in jmeter

Tags:

jmeter

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)

like image 218
user3614479 Avatar asked May 08 '14 01:05

user3614479


People also ask

What is CSV data set config used for in a JMeter test?

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.

How do I select different CSV files in JMeter runtime?

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.

What is the CSV data set config in JMeter?

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.

How do I use external test data sets in JMeter?

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’.

How to use CSV header lines in JMeter?

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 element?

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.


2 Answers

  1. Leave the variable names empty like on an attached snapshot.

enter image description here

  1. 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

  2. Request

enter image description here

like image 21
ashish bansal Avatar answered Sep 26 '22 15:09

ashish bansal


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.

like image 91
Giacomo1968 Avatar answered Sep 22 '22 15:09

Giacomo1968