我正在尝试从CSV文件中提取数据以用于POST请求,但出现以下错误
java.lang.IllegalArgumentException: Could not read file header line for file v2summaryreport
v2summaryreport是从另一个线程摘要报告中保存的,我想将该csv用于将要发布的一组新结果。
错误消息
020-09-23 16:26:14,826 INFO o.a.j.e.StandardJMeterEngine: All thread groups have been started
2020-09-23 16:26:14,831 INFO o.a.j.t.JMeterThread: Thread started: Thread Group 3-1
2020-09-23 16:26:14,832 INFO o.a.j.s.FileServer: Stored: v2summaryreport
2020-09-23 16:26:14,832 ERROR o.a.j.t.JMeterThread: Test failed!
java.lang.IllegalArgumentException: Could not read file header line for file v2summaryreport
at org.apache.jmeter.services.FileServer.reserveFile(FileServer.java:283) ~[ApacheJMeter_core.jar:5.1.1 r1855137]
at org.apache.jmeter.config.CSVDataSet.iterationStart(CSVDataSet.java:183) ~[ApacheJMeter_components.jar:5.1.1 r1855137]
at org.apache.jmeter.control.GenericController.fireIterationStart(GenericController.java:399) ~[ApacheJMeter_core.jar:5.1.1 r1855137]
at org.apache.jmeter.control.GenericController.fireIterEvents(GenericController.java:391) ~[ApacheJMeter_core.jar:5.1.1 r1855137]
at org.apache.jmeter.control.GenericController.next(GenericController.java:160) ~[ApacheJMeter_core.jar:5.1.1 r1855137]
at org.apache.jmeter.control.LoopController.next(LoopController.java:135) ~[ApacheJMeter_core.jar:5.1.1 r1855137]
at org.apache.jmeter.threads.AbstractThreadGroup.next(AbstractThreadGroup.java:87) ~[ApacheJMeter_core.jar:5.1.1 r1855137]
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:251) [ApacheJMeter_core.jar:5.1.1 r1855137]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_261]
Caused by: java.lang.IllegalArgumentException: File v2summaryreport must exist and be readable
at org.apache.jmeter.services.FileServer.createBufferedReader(FileServer.java:424) ~[ApacheJMeter_core.jar:5.1.1 r1855137]
at org.apache.jmeter.services.FileServer.readLine(FileServer.java:340) ~[ApacheJMeter_core.jar:5.1.1 r1855137]
at org.apache.jmeter.services.FileServer.readLine(FileServer.java:324) ~[ApacheJMeter_core.jar:5.1.1 r1855137]
at org.apache.jmeter.services.FileServer.reserveFile(FileServer.java:272) ~[ApacheJMeter_core.jar:5.1.1 r1855137]
任何对此的帮助将不胜感激
答案 0 :(得分:0)
文件v2summaryreport必须存在并且可读
这意味着JMeter在给定位置下找不到CSV文件
您需要提供文件的相对路径或完整路径(在大多数情况下,带有扩展名),因此我认为它应该类似于v2summaryreport.txt
或v2summaryreport.jtl
还请注意Execution Order of JMeter test elements,因为可能{strong>之前执行Configuration Element CSV数据集配置,因此包含结果的文件是还没有。
使用动态CSV文件不是非常受支持的用例,您可能需要考虑迁移到__CSVRead() function,有关示例实现,请参见How to Pick Different CSV Files at JMeter Runtime文章。
答案 1 :(得分:0)