Search code examples
jmeterlistenerperformance-testing

Unable to see Response Body in JMeter, View Results Tree listener


When I run a Http Request, to a page that should return a response body (I know it's working because I already tried in Postman). When I execute the sampler it's sends a 200 OK code, but the response body in the View Results Tree Listener, is empty. Why does this happen?

I use MAC OS, and I installed JMeter with Brew. I've already tried to add the following information in the user.properties file:

jmeter.save.saveservice.output_format=xml
jmeter.save.saveservice.response_data=true
jmeter.save.saveservice.samplerData=true
jmeter.save.saveservice.requestHeaders=true
jmeter.save.saveservice.url=true
jmeter.save.saveservice.responseHeaders=true

It looks like this:

enter image description here


Solution

  • The changes you've made don't have any impact onto View Results Tree listener output, they are only for .jtl results files.

    Try the following:

    1. Run your JMeter test in command-line non-GUI mode like

      jmeter -n -t test.jmx -l result.xml
      

      and open result.xml file with your faviourite text or XML viewer/editor. You should see something like:

      <?xml version="1.0" encoding="UTF-8"?>
      <testResults version="1.2">
          <httpSample t="93" it="0" lt="93" ct="42" ts="1568029799118" s="true" lb="HTTP Request" rc="200" rm="OK" tn="Thread Group 1-1" dt="text" by="759" sby="139" ng="1" na="1">
              <responseData class="java.lang.String">{
                  &quot;userId&quot;: 1,
                  &quot;id&quot;: 1,
                  &quot;title&quot;: &quot;delectus aut autem&quot;,
                  &quot;completed&quot;: false
                  }</responseData>
              <java.net.URL>http://jsonplaceholder.typicode.com/todos/1</java.net.URL>
          </httpSample>
      
      </testResults>
      

      where responseData tag contains XML-escaped response data. If there is some data in the file - most probably something is wrong with your JMeter installation, try re-installing it by downloading JMeter from the official website as the Brew package might be broken.

    2. Check jmeter.log file contents, if anything goes wrong JMeter normally writes a log message with the results.