Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想使用Response Assertion验证我的响应好坏。我已将响应字段设置为测试为响应消息。我已将模式设置为测试为“ok”。
问题是,即使我收到错误的响应,它也会在结果树侦听器中显示绿色信号。我已附上屏幕截图。如何解决这个问题?
这意味着您的响应在某处包含 OK。
如果要验证它是否返回 200 代码,请检查:
但是还要添加一个响应断言来检查页面中的文本,在这种情况下,将 OK 替换为文本并检查 Text response / And substring。