如何在jMeter中看到页面错误?

时间:2022-03-03 07:05:56

How can I see an error in JMeter?

如何在JMeter中看到错误?

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

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

2 个解决方案

#1


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).

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

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.

然后我们将一个View Results Tree添加到Thread Group(Add> Listener> View Results Tree)并将其配置为仅显示错误(选中Log / Display only Errors)。此结果树现在捕获所有错误页面及其请求。

#2


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

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

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

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

#1


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).

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

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.

然后我们将一个View Results Tree添加到Thread Group(Add> Listener> View Results Tree)并将其配置为仅显示错误(选中Log / Display only Errors)。此结果树现在捕获所有错误页面及其请求。

#2


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

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

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

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