Jmeter xml格式的非UI报告是不可读的

时间:2018-01-16 12:42:20

标签: xml csv jmeter

我在jmeter报告中遇到问题。 我想每晚运行我的测试计划,并查看它的结果。 我还想显示采样器响应消息(因此这意味着我必须使用格式XML,因为在提到的属性文件中,这仅支持XML)。 问题是报告不像CSV那样可读,无法执行排序或其他任何操作。 如果我通过UI手动运行并放置简单的数据编写器,它可以正常使用CSV,但是如果我在非UI中使用它必须使用XML文件。 提供我手动运行的CSV和非UI的xml文件。 他们以任何方式显示它更好吗?也许是HTML格式? 现在我需要在两个选项之间进行选择 1.可读格式(CSV),没有所有数据(响应消息) 2.具有我需要的所有数据的不可读格式(XML)

#---------------------------------------------------------------------------
# Results file configuration
#---------------------------------------------------------------------------

# This section helps determine how result data will be saved.
# The commented out values are the defaults.

# legitimate values: xml, csv, db.  Only xml and csv are currently supported.
#jmeter.save.saveservice.output_format=csv


# true when field should be saved; false otherwise

# assertion_results_failure_message only affects CSV output
#jmeter.save.saveservice.assertion_results_failure_message=true
#
# legitimate values: none, first, all
#jmeter.save.saveservice.assertion_results=all
#
#jmeter.save.saveservice.data_type=true
#jmeter.save.saveservice.label=true
#jmeter.save.saveservice.response_code=true
# response_data is not currently supported for CSV output
#jmeter.save.saveservice.response_data=false
# Save ResponseData for failed samples
#jmeter.save.saveservice.response_data.on_error=false
#jmeter.save.saveservice.response_message=true
#jmeter.save.saveservice.successful=true
#jmeter.save.saveservice.thread_name=true
#jmeter.save.saveservice.time=true
#jmeter.save.saveservice.subresults=true
#jmeter.save.saveservice.assertions=true
#jmeter.save.saveservice.latency=false
# Only available with HttpClient4
#jmeter.save.saveservice.connect_time=false
#jmeter.save.saveservice.samplerData=true
#jmeter.save.saveservice.responseHeaders=true
#jmeter.save.saveservice.requestHeaders=true
#jmeter.save.saveservice.encoding=false
#jmeter.save.saveservice.bytes=false
# Only available with HttpClient4
#jmeter.save.saveservice.sent_bytes=false
#jmeter.save.saveservice.url=false
#jmeter.save.saveservice.filename=false
#jmeter.save.saveservice.hostname=false
#jmeter.save.saveservice.thread_counts=false
#jmeter.save.saveservice.sample_count=false
#jmeter.save.saveservice.idle_time=false

# Timestamp format - this only affects CSV output files
# legitimate values: none, ms, or a format suitable for SimpleDateFormat
#jmeter.save.saveservice.timestamp_format=ms
#jmeter.save.saveservice.timestamp_format=yyyy/MM/dd HH:mm:ss.SSS

# For use with Comma-separated value (CSV) files or other formats
# where the fields' values are separated by specified delimiters.
# Default:
#jmeter.save.saveservice.default_delimiter=,
# For TAB, since JMeter 2.3 one can use:
#jmeter.save.saveservice.default_delimiter=\t

# Only applies to CSV format files:
# Print field names as first line in CSV
#jmeter.save.saveservice.print_field_names=true

# Optional list of JMeter variable names whose values are to be saved in the result data files.
# Use commas to separate the names. For example:
#sample_variables=SESSION_ID,REFERENCE
# N.B. The current implementation saves the values in XML as attributes,
# so the names must be valid XML names.
# Versions of JMeter after 2.3.2 send the variable to all servers
# to ensure that the correct data is available at the client.

# Optional xml processing instruction for line 2 of the file:
# Example:
#jmeter.save.saveservice.xml_pi=<?xml-stylesheet type="text/xsl" href="../extras/jmeter-results-detail-report.xsl"?>
# Default value:
#jmeter.save.saveservice.xml_pi=

# Prefix used to identify filenames that are relative to the current base
#jmeter.save.saveservice.base_prefix=~/

# AutoFlush on each line written in XML or CSV output
# Setting this to true will result in less test results data loss in case of Crash
# but with impact on performances, particularly for intensive tests (low or no pauses)
# Since JMeter 2.10, this is false by default
#jmeter.save.saveservice.autoflush=false

提供了一张照片 enter image description here

enter image description here

enter image description here

2 个答案:

答案 0 :(得分:1)

您可以使用默认JMeter result save configuration来生成CSV输出。

此外您可以添加ie View Results Tree侦听器,将完整的请求和响应数据保存到单独的文件中(您可以通过“文件名”指定)输入)

JMeter View Results Tree

测试完成后,您将获得2个结果文件:

  1. 带基线指标的csv文件
  2. xml文件,包含完整的请求和响应详细信息。
  3. 请注意,存储请求和响应数据会产生大量IO开销,并且在高负载时可能会对您的测试产生负面影响,因此一旦您对脚本行为感到满意,请关闭此View Results Tree侦听器并配置JMeter仅存储绝对必需的指标。理想情况下you should be running your test with all the listeners disabled

答案 1 :(得分:0)

响应消息将保存为CSV格式,与您显示的黄色字段相同。

所以你应该可以使用网络报告: