0
votes

I am using JMeter 5.1.1.

I have a CSV file looks like this

enter image description here

enter image description here

When I call HTTP Request like this

enter image description here

I get this

enter image description here

Jmeter doesn't take the value but just pass the name of the variable to the URI.

But if I take the second column CustomerParam by putting ${CustomerParam} , then JMeter will grab the value (instead of the name of the variable).

I am wondering how can I get the values of the first column ?

Thanks.

3
In CSV data set config add CustomerID,CustomerParam in Variable names. Also change Ignore first line to trueAdnan
I see similar problem where only my first column in csv is resolved and the rest of them are undefined. Well, in fact Debug Sampler shows all columns but in BeanShell sampler or JDBC sampler, only first column is resolved!!!user3739116

3 Answers

3
votes

I found the root cause. When creating the CSV file using the newest Microsoft Excel 365 , save it as CSV , not CSV UTF-8.

When I saved the file using CSV, JMeter works perfectly fine. But when I saved it using CSV UTF-8, then the issue I described earlier does appear.

enter image description here

1
votes

If Variables are referenced as follows:

${VARIABLE}

If an undefined function or variable is referenced, JMeter does not report/log an error - the reference is returned unchanged. For example, if UNDEF is not defined as a variable, then the value of ${UNDEF} is ${UNDEF}.

Input the Variable name in your CSV Data Set Config as follows (If your CSV data set looks exactly above where variable names are present in the first line):

enter image description here

Or, you can just remove the variable names from the first line of your CSV file and make the config as below:

enter image description here

1
votes

I cannot reproduce your issue using the same CSV Data Set config:

enter image description here

The evidence that the variables have been read (assumes Debug Sampler and View Results Tree listener combination)

enter image description here

So double check the following:

  1. Your CSV file integrity as it might be an issue with the data itself, i.e. if there is a BOM at the beginning - you will have to remove it as the BOM will be added to the first variable name (use aforementioned Debug Sampler and View Results Tree listener to verify which variables are defined)
  2. An problem with the CSV file operating-system wise (i.e. typo in location or file permission issue). Normally JMeter should report any errors connected with failure of reading the CSV file in jmeter.log