apache / jmeter

Apache JMeter open-source load testing tool for analyzing and measuring the performance of a variety of services
https://jmeter.apache.org/
Apache License 2.0
8.11k stars 2.06k forks source link

Cannot read csv file when executing script on command line after referencing csv file with relative path in csv data set #5283

Open asfimport opened 4 years ago

asfimport commented 4 years ago

TonyChen (Bug 64298): 我有一个csv文件ENVname.csv其中有一条数据,我在一个测试计划cms.jmx中添加了csv data set插件,在插件中以相对路径的方式引用./ENVname.csv,我在一个HTTP请求插件中引用该csv中的变量名。之后我将cms.jmx和ENVname.csv两个文件放到一个$JMETER_HOME/script目录下,然后在script目录下打开终端,通过执行命令../bin/jmeter -n -t cms.jmx -l result.jtl -e -o ./report -R 192.168.100.100:1099,命令执行完之后,我检查result.jtl文件,发现没有HTTP请求执行的记录,我的远程服务的数据库中也没有创建五条数据。我再打开jmeter客户端,通过客户端打开cms.jmx文件,在客户端上直接执行该脚本,之后数据库成功添加了一条数据。我在jmeter官方网站在没有找到相关的解决方案,请告诉我应该怎样解决这个问题?我的操作系统是Mac OS X10.14.6,使用oracle jdk 1.8.0_231版本

Created attachment Jietu20200401-210210.jpg: 命令行方式执行时的日志

命令行方式执行时的日志

Severity: normal OS: All

asfimport commented 4 years ago

@pmouawad (migrated from Bugzilla): Translation: I have a csv file ENVname.csv with a piece of data in it. I added a csv data set plugin to a test plan cms.jmx, which references ./ENVname.csv as a relative path in the plugin. I am requesting a plugin in an HTTP Reference the variable name in the csv. After that, I put the two files cms.jmx and ENVname.csv into a $ JMETER_HOME / script directory, and then open the terminal in the script directory, by executing the command ../ bin / jmeter -n -t cms.jmx -l result .jtl -e -o ./report -R 192.168.100.100:1099. After the command was executed, I checked the result.jtl file and found that there was no record of HTTP request execution, and no five pieces of data were created in my remote service database. I then open the jmeter client, open the cms.jmx file through the client, execute the script directly on the client, and then the database successfully adds a piece of data. I did not find a solution on the official website of jmeter. Please tell me how to solve this problem? My operating system is Mac OS X 10.14.6, using oracle jdk 1.8.0_231 version

asfimport commented 4 years ago

@pmouawad (migrated from Bugzilla): Hello, Can you attach jmeter.log file

Thanks