1
votes

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

2
can you show screenshot? Did you choose Response body tab?user7294900
Updated quesiton. And yes, I am sure I am in the Response Body tabbsullit
That question does not have a answerbsullit

2 Answers

0
votes

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.

1
votes

I had this exact issue, and the final answer was to use either Java version 9 or in my case it was Java version 8. That fixed the issue and I am now able to see the response body and response headers. enter image description here