我有类似的问题,阻止我.我需要用Jenkins运行我的JMeter测试.但Jenkins验证JMeter构建在实际失败时是否成功.我想知道我做错了什么,以便当断言失败时jmeter不会返回失败.
我运行一个调用jMeter的
Windows Batch脚本.这是如何做:
命令行
cd C:\apache-jmeter-3.1\bin
jmeter -n -c -t C:\Users\maria\Desktop\Automation\WIP\Test-page.jmx -l C:\Users\maria\Desktop\Automation\WIP\Test-page.xml
并将结果保存在.xml中,以使用Performance插件(v 2.0)和Jenkins ver验证报告. 2.32.1
安慰
Created the tree successfully using C:\Users\maria\Desktop\Automation\WIP\Test-page.jmx
Starting the test @ Fri Dec 30 11:05:58 GMT 2016 (1483095958952)
Waiting for possible Shutdown/StopTestNow/Heapdump message on port 4445
summary = 1 in 00:00:00 = 3.1/s Avg: 206 Min: 206 Max: 206 Err: 1 (100.00%)
Tidying up ... @ Fri Dec 30 11:05:59 GMT 2016 (1483095959326)
... end of run
Performance: Recording JMeter reports 'C:\Users\maria\Desktop\Automation\WIP\Test-page.xml'
Performance: Parsing JMeter report file 'C:\Jenkins\jobs\Test demo\builds\3\performance-reports\JMeter\Test-page.xml'.
Performance: Percentage of errors greater or equal than 0% sets the build as unstable
Performance: Percentage of errors greater or equal than 0% sets the build as failure
Finished: SUCCESS
如你所见,我有1个错误.但Performance插件将构建设置为成功.
Jmeter属性
jmeter.save.saveservice.assertion_results=all
jmeter.save.saveservice.output_format=xml
jmeter.save.saveservice.response_data=true
尝试过但我没有为我工作:
>旧版本的Performance插件(v 1.11和v.16)
> .jtl格式
> .xml
> .csv
>最后在命令行中添加“echo”
>设置jmeter.save.saveservice.response_data = true
想出如何让Performance插件计算错误并提高“失败”标志:(
请帮忙.