Search code examples
csvvariablesjmeterconfiguration-files

Jmeter - Error when using variable to hold CSV variable names


Running some tests successfully in jmeter and am now parameterising them and have come across the following problem.

I am using a csv file which contains a number of variables I am using in the tests. Within my test I have defined the CSV variables in the following format:

Title,ResponseCode,CheckForTest,ExpectedData

This works fine when that is defined in the CSV config processor.

However, when I try to put that into a properties file in the form:

TESTVARS=Title,ResponseCode,CheckForTest,ExpectedData

I get this error:

Could not split CSV header line jav.io.IOException: Missing trailing quote-char in quoted field:["]

Any idea what this means, and how I fix it?

Not that I am using v2.13 of jmeter and cannot use an upgraded version at the moment so I need a solution for v2.13

Many thanks


Solution

  • When looking at JMeter source code:

        String i$ = server.reserveFile(threadVars, this.getFileEncoding(), this.alias, true);
        try {
          this.vars = CSVSaveService.csvSplitString(i$, delim.charAt(0));
          this.firstLineIsNames = true;
        } catch (IOException var11) {
          throw new IllegalArgumentException("Could not split CSV header line from file:" + threadVars, var11);
        }
    

    Apparently, it cannot read the header of your CSV file, and split it to variable names.