[英]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).当我运行 Http 请求时,应该返回响应正文的页面(我知道它正在工作,因为我已经在 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.
当我执行采样器时,它会发送 200 OK 代码,但查看结果树侦听器中的响应正文为空。 Why does this happen?
为什么会发生这种情况?
I use MAC OS, and I installed JMeter with Brew.我使用 MAC 操作系统,并使用 Brew 安装了 JMeter。 I've already tried to add the following information in the user.properties file:
我已经尝试在 user.properties 文件中添加以下信息:
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:它看起来像这样:
The changes you've made don't have any impact onto View Results Tree listener output, they are only for .jtl results files. 您所做的更改对View Results Tree侦听器输出没有任何影响,它们仅适用于.jtl结果文件。
Try the following: 请尝试以下操作:
Run your JMeter test in command-line non-GUI mode like 在命令行非GUI模式下运行JMeter测试,例如
jmeter -n -t test.jmx -l result.xml
and open result.xml
file with your faviourite text or XML viewer/editor. 并使用
result.xml
夹文本或XML查看器/编辑器打开result.xml
文件。 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. 其中
responseData
标记包含XML转义的响应数据。 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. 如果文件中有一些数据-很可能是您的JMeter安装出现问题,请尝试从官方网站下载JMeter来重新安装它,因为Brew软件包可能已损坏。
Check jmeter.log
file contents , if anything goes wrong JMeter normally writes a log message with the results. 检查
jmeter.log
文件的内容 ,如果有任何问题,JMeter通常会在日志消息中写入结果。
I see you didn't load the generated *.jtl
file in your "View results Tree" panel.我看到您没有在“查看结果树”面板中加载生成的
*.jtl
文件。 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.
请记住,您必须添加侦听器,在非 GUI 模式下运行一次测试,然后 *.jtl 文件将包含结果。 Open them here:
在此处打开它们:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.