目录
1、打开cmd窗口
使用win+R,输入cmd,打开命令窗口,定位到jmeter脚本所在的目录,例如我的是:D:\workplace\Cworkfiles\Gocument\Test\CMDB\Scrpit
C:\Users\21030>D:
D:\>cd D:\workplace\Cworkfiles\Gocument\Test\CMDB\Scrpit
2、执行脚本
执行jmeter -n -t D:\workplace\Cworkfiles\Gocument\Test\CMDB\Scrpit\数据中 心.jmx -l D:\workplace\Cworkfiles\Gocument\Test\CMDB\ResultReport\jtl\test.jtl -e -o D:\workplace\Cworkfiles\Gocument\Test\CMDB\ResultReport\html\report
D:\workplace\Cworkfiles\Gocument\Test\CMDB\Scrpit>jmeter -n -t D:\workplace\Cworkfiles\Gocument\Test\CMDB\Scrpit\数据中 心.jmx -l D:\workplace\Cworkfiles\Gocument\Test\CMDB\ResultReport\jtl\test.jtl -e -o D:\workplace\Cworkfiles\Gocument\Test\CMDB\ResultReport\html\report
Creating summariser <summary>
Created the tree successfully using D:\workplace\Cworkfiles\Gocument\Test\CMDB\Scrpit\数据中心.jmx
Starting standalone test @ Thu Oct 20 14:13:22 GMT+08:00 2022 (1666246402201)
Waiting for possible Shutdown/StopTestNow/HeapDump/ThreadDump message on port 4445
summary = 3 in 00:00:21 = 0.1/s Avg: 7128 Min: 1 Max: 21064 Err: 1 (33.33%)
Tidying up ... @ Thu Oct 20 14:13:43 GMT+08:00 2022 (1666246423630)
... end of run
D:\workplace\Cworkfiles\Gocument\Test\CMDB\Scrpit>
注释:
jmeter -n -t 【Jmx脚本位置】-l 【中间文件result.jtl位置】-e -o 【报告存放文件夹】
参数说明:
-n: 非GUI模式执行JMeter
-t: 执行测试文件所在的位置
-l: 指定生成测试结果的保存文件,jtl文件格式
-e: 测试结束后,生成测试报告
-o: 指定测试报告的存放位置
3、查看报告
在报告存存放的路径下可以看到生成的报告: