jmeter断言

方法一

 

 String responseString = prev.getResponseDataAsString();
String responseCheck ="\"code\":200";
if (responseString.contains(responseCheck))
{
     prev.setSuccessful(true);
}else{
     log.info("Error, responseString: "+responseString);
     prev.setSuccessful(false);
}

方法二

 

posted @ 2021-08-27 12:16  tiansc  阅读(56)  评论(0编辑  收藏  举报