如何查看 jMeter 中的页面错误?

发布于 2024-07-23 12:41:05 字数 61 浏览 3 评论 0原文

如何查看 JMeter 中的错误?

换句话说,如果测试失败,如何才能看到返回错误的页面?

How can I see an error in JMeter?

In other words, if a test fails, How is it possible to see the page returned with the error ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

柠北森屋 2024-07-30 12:41:05

在我们的应用程序中,我们有一个显示特定消息的自定义错误页面。 在 JMeter 中,我们向测试计划添加了响应断言添加 > 断言 > 响应断言)。 我们将此断言配置为对此消息进行模式检查(例如检查“发生错误”或错误页面显示的任何内容)。

然后,我们将查看结果树添加到线程组(添加 > 侦听器 > 查看结果树)并将其配置为仅显示错误(检查日志/仅显示错误)。 该结果树现在捕获所有错误页面及其请求。

In our application we have a custom error page displaying a certain message. In JMeter we added a Response Assertion to the TestPlan (Add > Assertions > Response Assertion). We configured this assertion to have a pattern checking for this message (e.g. check for "error occurred" or whatever your error page shows).

Then we added a View Results Tree to the Thread Group (Add > Listener > View Results Tree) and configured it to display the errors only (check Log/Display only Errors). This result tree now captures all error pages along with their requests.

萧瑟寒风 2024-07-30 12:41:05

根据您设置测试的方式,您很可能会从服务器收到 404、401 或 500 错误代码。

然后,您可以使用服务器(不是 jMeter)的访问日志来查看返回错误的页面。

Depending on how you set up your test, you will most likely get a 404, 401 or 500 error code from your server.

You can then use the access logs of the server (not jMeter) to see which page it was that returned the error.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文