1

I'd like JMeter to save requests/responses to XML file ONLY if the request failed. All passed request should not be logged. How can I do that?

automatictester
  • 2,436
  • 1
  • 19
  • 34

1 Answers1

2

In order to store response data for failed requests all you need is just to add the next 2 lines to user.properties file (lives under "bin" folder of your JMeter installation)

jmeter.save.saveservice.output_format=xml
jmeter.save.saveservice.response_data.on_error=true

In regards to saving requests, I'm afraid you have only 2 choices:

  1. save all requests (no matter of pass/fail status)
  2. save nothing

Theoretically it can be worked around using scripting-enabled test elements like Beanshell Listener in combination with Sample Variables or patching JMeter source code, but there is no out-the-box flag to trigger conditional storing of request data.

See Apache JMeter Properties Customization Guide for more information on JMeter properties types and ways of setting/overriding them

Dmitri T
  • 159,985
  • 5
  • 83
  • 133