简体   繁体   English

无法使用 Jmeter 以 xml 格式获取带有 Response Data_Response Header 和 Request 标头的报告

[英]Unable to get report with Response Data_Response Header and Request header in xml format using Jmeter

i am running jmeter test through non-gui mode and i want to view response data, response header and request header in my Log File.我正在通过非 gui 模式运行 jmeter 测试,我想在我的日志文件中查看响应数据、响应标头和请求标头。

Therefore i have change the below properties in jmeter.properties file因此我在 jmeter.properties 文件中更改了以下属性

jmeter.save.saveservice.responseHeader=true
jmeter.save.saveservice.requestHeader=true
jmeter.save.saveservice.output_format=xml
jmeter.save.saveservice.response_data=true

But after running the Jmeter Test through command Line,it is not running and through the below error:但是通过命令行运行 Jmeter 测试后,它没有运行并出现以下错误:

Jmeter version: 5:4:3 Jmeter 版本:5:4:3

Java Version:1.8.0_292 Java版本:1.8.0_292

 ./jmeter  -Jgroup1.threads=1 -Jgroup1.rampup=1 -Jgroup1.loop=1 -n -t /Users/lipsa_priyadarshini/MDE_Engage-Engage_Performance_Test/Kerg-Postgresql-Performance-Test.jmx  -l /Users/lipsa_priyadarshini/Desktop/awsmigration/JmeterTestLogs/log.xml -e -o/Users/lipsa_priyadarshini/Desktop/awsmigration/HTML/report1
Creating summariser <summary>Error in NonGUIDriver java.lang.IllegalArgumentException: Report generation requires csv output format, check 'jmeter.save.saveservice.output_format' property
An error occurred: Error in NonGUIDriver Report generation requires csv output format, check 'jmeter.save.saveservice.output_format' property

Note: When this output format property is commented out in properties file #jmeter.save.saveservice.output_format=xml and by passing path of log file with .xml extension , it creates xml file but does not include response data, response body, response header even if the property is true in the file.注意:当此输出格式属性在属性文件#jmeter.save.saveservice.output_format=xml中被注释掉并通过以 .xml 扩展名传递日志文件的路径时,它会创建 xml 文件,但不包括响应数据、响应正文、响应即使该属性在文件中为 true,也可以标头。 Therefore as per my observation we can see the data, body in log file when we will set output format file as true but its not alllowing here.因此,根据我的观察,当我们将输出格式文件设置为 true 时,我们可以在日志文件中看到数据、正文,但此处不允许。

can anyone debug the issue and let me know the resolution.任何人都可以调试问题并让我知道解决方案。

As per documentation :根据 文档

The dashboard generator is a modular extension of JMeter.仪表板生成器是 JMeter 的模块化扩展。 Its default behavior is to read and process samples from CSV files to generate HTML files containing graph views它的默认行为是从CSV 文件中读取和处理样本以生成包含图形视图的 HTML 文件

Which means that you won't be able to generate the dashboard from the .jtl results file in XML format.这意味着您将无法从 XML 格式的.jtl 结果文件生成仪表板。

so you need to remove this bit:所以你需要删除这个位:

-e -o/Users/lipsa_priyadarshini/Desktop/awsmigration/HTML/report1

from your command line, in this case the log.xml will have the details you're looking for.从您的命令行,在这种情况下, log.xml将包含您正在寻找的详细信息。

If you need both the ability to generate the HTML Reporting Dashboard and store headers and response data consider adding a listener, ie Simple Data Writer to your test plan and configure where and what to store:如果您需要生成 HTML 报告仪表板并存储标题和响应数据的能力,请考虑在您的测试计划中添加一个侦听器,即简单数据编写器,并配置存储位置和内容:

在此处输入图像描述

More information: How to Save Response Data in JMeter更多信息:如何在 JMeter 中保存响应数据

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM