简体   繁体   中英

JMeter not reading variable from CSV file

I'm new to Jmeter and am trying to use variables from a CSV file in the path of my HTTP GET request.

I've looked through various tutorials and answers to this question, but I still can't figure out what I'm doing wrong. The file just has one header (ID). It works if I enter the ID in the path, but as soon as I try read it from the CSV file, it fails:

在此处输入图片说明

在此处输入图片说明

在此处输入图片说明

在此处输入图片说明

Your configuration looks good, double check jmeter.log file for any suspicious entries.

Other recommendations:

  • Given you have only a single column it might be easier to use __StringFromFile() function directly in the HTTP Request sampler body like:

     /api/Users/${__StringFromFile(c:\\Automation\\Test.csv,,,)}
  • I believe Content-Type and Authorization should go in HTTP Header Manager , not in the request parameters

See Testing SOAP/REST Web Services Using JMeter article for more details.

The problem wasn't with the reading of the variable. I thought that the first line of the file would be treated as a header, but it reads the first line of the file as a variable, so my file looked like:

ID 001

It read "ID", when I wanted it read "001.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM