Reputation: 111
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:
Upvotes: 3
Views: 13455
Reputation: 12817
I see you didn't load the generated *.jtl
file in your "View results Tree" panel. You should browse and open that file and then you can see the results. Remember, you must add the listener, run the tests in non-GUI mode once, and the *.jtl file would then contain the results. Open them here:
And I think the correct results are not shown.
Upvotes: 1
Reputation: 51
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.
Upvotes: 1
Reputation: 168217
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:
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">{
"userId": 1,
"id": 1,
"title": "delectus aut autem",
"completed": 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.
Check jmeter.log
file contents, if anything goes wrong JMeter normally writes a log message with the results.
Upvotes: 1