【问题标题】:Jmeter: org.apache.jmeter.report.core.SampleException: Could not locate input sample filesJmeter:org.apache.jmeter.report.core.SampleException:找不到输入示例文件
【发布时间】:2020-03-03 18:30:44
【问题描述】:

我正在尝试使用以下命令使用 CLI 运行 jmeter 负载测试脚本:

jmeter -n -t {JMETER SCRIPT(JMX)的路径} -l {JTL 文件的路径} -e -o {您希望保存报告仪表板的文件夹路径}

示例:

H:\Apache Jmeter 5.0\bin>jmeter -n -t C:\stressTest\Master-Script.jmx -l C:\stressTest\Results\Result-${currentTime}.csv -e - o C:\stressTest\Html\${currentTime}

脚本按预期运行并生成 csv 文件,但在生成 html 报告(网络报告仪表板)时,我得到以下输出:

Starting the test @ Tue Mar 03 13:01:30 EST 2020 (1583258490364)
Waiting for possible Shutdown/StopTestNow/Heapdump message on port 4445
summary =      0 in 00:00:00 = ******/s Avg:     0 Min: 9223372036854775807 Max: -9223372036854775808 Err:     0 (0.00%)
Tidying up ...    @ Tue Mar 03 13:01:36 EST 2020 (1583258496832)
Error generating the report: org.apache.jmeter.report.core.SampleException: Could not locate input sample files !
... end of run 

我还很新,我可能会在这里遗漏一些东西。任何帮助表示赞赏。

提前致谢。

【问题讨论】:

标签: jmeter load-testing stress-testing jmeter-5.0


【解决方案1】:

cmd.exe 都无法解析您的${currentTime} 表达式,如果您想生成带有时间戳的 .jtl 结果文件,您需要使用date 命令,例如:

H:\Apache Jmeter 5.0\bin>jmeter -n -t C:\stressTest\Master-Script.jmx -l C:\stressTest\Results\Result-%date:~10,4%_%date:~4,2%_%date:~7,2%.csv -e -o C:\stressTest\Html\%date:~10,4%_%date:~4,2%_%date:~7,2%

更多信息:How Do I Run JMeter in Non-GUI Mode?

【讨论】:

  • 感谢您的回复。看了你的回答,我有两个问题。但首先,让我澄清一下,运行“\Result-${currentTime}”是我在测试脚本中创建的一个变量:Name: currentTime Value: ${__time(dd-MM-yyyy-HH-mm-ss)} Q1。当我运行以下命令时,会生成 csv 报告,但不会生成 HTML。 jmeter -n -t C:\stressTest\Master-Script.jmx -l C:\stressTest\Results\Result-${currentTime}.csv -e -o C:\stressTest\Html\${currentTime} Q2。当我运行你的命令时,它会生成报告和 html 仪表板。此外,还有不同的黑白报告
猜你喜欢
  • 1970-01-01
  • 2015-12-18
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-12-06
  • 2021-06-30
相关资源
最近更新 更多