I'm trying to replace a variable in the GET
path without using any parameter name/value combination as the REST API is using ODATA
format.
Example: http://localhost/GetEmployeeData('EMP12345')
In my JMeter script, I have added HTTP Request and set the path like this:
/GetEmployeeData('${empid}')
In my CSV file, I have a single column defined like this:
empid EMP12345
In CSV Dataset config, I'm pointing to the CSV file and setting the variable name to empid
.
What I'm doing wrong?. I get a bad request error and the ${empid}
is not getting replaced from the CSV file.
Please help.
We cannot help without seeing your configuration so for the time being I can give you only few pieces of advice:
Try replacing the CSV Data Set Config with __StringFromFile() or __CSVRead() functions, the syntax would be:
/GetEmployeeData('${__StringFromFile(/path/to/file.csv,,,)}')
/GetEmployeeData('${__CSVRead(/path/to/file.csv,0)}')
Check out Apache JMeter Functions - An Introduction article for more information on JMeter Functions concept.
I cannot reproduce your issue having .csv file in JMeter's "bin" folder and the following CSV Data Set Config setup: