作者:Gakki
BeanShell断言
- 判断响应内容是否为 200 , 如果非 200 状态,则保存响应数据。
String Str = "200";
reshead = prev.getResponseCode();
resbody = prev.getResponseDataAsString();
//log.info(reshead)
if(reshead.contains(Str) == false){
Failure = true;
String Msg = "error_code!!!!";
FailureMessage = Msg + "响应内容:\n" + resbody + "\n";
log.info(FailureMessage);
}
BeanShell断言
响应内容
网友评论