Jmeter html报告包括请求 - 响应数据

时间:2016-11-02 11:32:22

标签: ant jmeter build.xml

我想问你是否知道需要设置什么来结束Jmeter html报告,其中包括请求 - 响应数据(JSON)成功/错误。我尝试了以下设置,但没有帮助:

jmeter.properties

jmeter.save.saveservice.output_format=xml
jmeter.save.saveservice.data_type=true
jmeter.save.saveservice.label=true
jmeter.save.saveservice.response_code=true
jmeter.save.saveservice.response_data=true
jmeter.save.saveservice.response_data.on_error=true
jmeter.save.saveservice.response_message=true
jmeter.save.saveservice.successful=true
jmeter.save.saveservice.assertions=true
jmeter.save.saveservice.samplerData=true
jmeter.save.saveservice.responseHeaders=true
jmeter.save.saveservice.requestHeaders=true

试图在ant build.xml中强制它们

    <!-- Force suitable defaults -->
    <property name="request.threads" value="1"/>
    <property name="request.threads" value="1"/>
    <property name="request.loop" value="1"/>
    <property name="jmeter.save.saveservice.data_type" value="true"/>
    <property name="jmeter.save.saveservice.label" value="true"/>
    <property name="jmeter.save.saveservice.response_code" value="true"/>
    <property name="jmeter.save.saveservice.response_data" value="true"/>
    <property name="jmeter.save.saveservice.response_message" value="true"/>
    <property name="jmeter.save.saveservice.successful" value="true"/>
    <property name="jmeter.save.saveservice.assertions" value="true"/>
    <property name="jmeter.save.saveservice.samplerData" value="true"/>
    <property name="jmeter.save.saveservice.responseHeaders" value="true"/>
    <property name="jmeter.save.saveservice.requestHeaders" value="true"/>
    <property name="jmeter.save.saveservice.output_format" value="xml"/>
    <property name="jmeter.save.saveservice.assertion_results" value="all"/>
    <property name="jmeter.save.saveservice.bytes" value="true"/>
    <property name="file_format.testlog" value="${format}"/>
    <property name="jmeter.save.saveservice.response_data.on_error"value="${funcMode}"/>
enter code here

谢谢

1 个答案:

答案 0 :(得分:0)

最快和最简单的解决方案是在所有请求中添加一个空响应断言,例如:

Response Assertion

当你的考试结束时,你会看到类似的东西:

Ant Report

作为副作用会导致所有采样器失效

有关使用断言有条件地设置通过/失败条件的详细信息,请参阅How to Use JMeter Assertions in Three Easy Steps文章。

如果您想添加响应数据而不是让采样器失败,那么它就更加XSLT相关的问题,因为您需要修改XSL样式表文件以添加额外的列