为什么我得到:Error:"HTTP请求响应断言:测试失败:文本应包含/302/" [英] Why am I getting :Error : "HTTP request Response Assertion:Test failed:text expected to contain /302/"
问题描述
我为什么得到:
HTTP请求响应断言:测试失败:断言结果"中的文本预期包含/302/错误
HTTP request Response Assertion:Test failed:text expected to contain /302/" error in "Assertion Results"
推荐答案
这是因为您没有在断言中检查正确的要测试的字段",因此需要检查响应代码而不是文本响应:
It's because you didn't check in your assertion the correct "Field to Test", you need to check Response Code not Text Response:
您的声明也失败了,因为您没有获得302(重定向),而是获得了200(成功). 因此,除非您真的只想要302,否则只需删除此断言即可,因为如果响应代码严格高于399,默认JMeter会将Sample标记为失败
Also your assertion is failing because you don’t get a 302(redirect) but a 200 (success) . So unless you really only want 302, just remove this assertion as bu default JMeter will mark Sample as failed if response code is strictly higher than 399
这篇关于为什么我得到:Error:"HTTP请求响应断言:测试失败:文本应包含/302/"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!