Jmeter打印异常响应报文
作者:互联网
import org.json.*; static String responseData = prev.getResponseDataAsString(); //log.info("响应体:"+responseData); JSONObject responseJson = new JSONObject(responseData); int code = responseJson.getInt("code"); if(code != 200 ) { Failure = true; FailureMessage = "作业输出文件上传-请求断言失败,响应体为:"+responseJson; } else { Failure = false; FailureMessage = "请求断言成功"; }
标签:responseData,code,JSONObject,报文,打印,FailureMessage,Failure,responseJson,Jmeter 来源: https://www.cnblogs.com/apple2016/p/15589890.html