Variables From CSV File

Download

This Config item allows you to load variable values from CSV file. Variable names and values taken from CSV file, name from first column, value from second column, respectively.

Tutorial

Let's create a text file c:\temp\testvariables.csv with following content:

First_Variable,here comes value 1
Second_Variable,and here value 2

Let's create test plan with Variables From CSV File, Thread Group, Debug Sampler and View Results Tree. Then configure Variables From CSV File, give it filename testvariables.csv, optional variable prefix `MyVar_` and column separator ','. Now your plan should look like this:

Save this test plan to c:\temp\test1.jmx.

Now, run the test, go to View Results Tree and click on Debug Sampler, then click on Response data tab. You'll see that your variables from testvariables.csv are defined in JMeter, e.g.:

JMeterVariables:
MyVar_First_Variable=here comes value 1
MyVar_Second_Variable=and here value 2
JMeterThread.last_sample_ok=true
JMeterThread.pack=org.apache.jmeter.threads.SamplePackage@10cc9b4
START.HMS=153028
START.MS=1264671028968
START.YMD=20100128
TESTSTART.MS=1264671163750