Follow

CSV file upload

In Jmeter you can pass CSV data using 'CSV Data Set Config' element implemented in your Jmeter script. As BlazeMeter Is 100% JMeter compatible, you can use the same method by uploading the CSV to the BlazeMeter web application.

How to specify the CSV data file path ?

The CSV Data Set Config element has a field called "Filename" where you need to specify the file name of your CSV along with its' path.

By default JMeter starts to look for data files in the JMeter root/home folder (\apache-jmeter-X.XX\bin) or the same folder where the JMeter script(.JMX file) resides.

When you run a test in BlazeMeter, a cloud instance is created to which all the files uploaded in your test are copied - to the JMeter home directory of this instance. Hence just specify the file names without a path.

For example if you upload a file named: my_file.csv, simply use the name: my_file.csv as the file name (no path) or /home/jmeter/my_file.csv in CSV data set Config element.

All files get downloaded to all of the running JMeter engines as well as to the JMeter console.

How many files can I add in a BlazeMeter test ?

You can add any files you need to be used as part of your script during your test.  

Run a multiple engines test with a single CSV file

If you wish to run a multi engine test using a single CSV file for all of them without creating duplicate values, simply use the 'Split data file CSV' option.

For example: you run a 1000 concurrent users test, on 5 engines. You have uploaded a CSV file containing 1000 unique user names to simulate a registration scenario. Press 'Split data file CSV' in the test configuration page, and when the test is initiating the CSV file will be split 5 ways and directed to a different engine.

Run a 'Multi Test' with a single CSV file

A Multi Test is a feature which enables you to run several tests simultaneously. Please refer to this article for more information regarding the Multi Test. If you wish to use one CSV data set for the entire Multi Test (unique data sets per engine, per test) then click on 'Data Files' and then upload the CSV into the pop up window. You will then be presented with a choice whether to split the CSV or not.

How to setup a different CSV file for each JMeter engine?

If you want to use multiple JMeter engines with a different CSV file per JMeter engine, you will need to upload a different file for each JMeter engine and use a parameter to differentiate each file.

Each JMeter engine uses a distinct parameter ${__P(InstanceID)}. Please note that the “InstanceID” values start from 1 for the JMeter engines.

In the example above, in case you are using two JMeter engines, you can upload files named file1.csv and file2.csv. In the CSV “Filename” field you should specify: file${__P(InstanceID)}.csv.

The first JMeter engine will read file1.csv. The second will read file2.csv.

Want to learn more about getting started with JMeter? You'll want to view our on-demand webcast recording, How to Make Performance Testing with JMeter Simple
Have more questions? Submit a request

1 Comments

  • 0
    Avatar
    Dean Goodmanson

    In your example, the CSV column names are defined in the JMeter Variable Names field.

    If we leave this field blank, and supply a header to the CSV, will the CSV Split preserve this header on each of the split files? (Or do we need tochange our tests to include the variable names and omit the header from our CSV)

Please sign in to leave a comment.