The JSR223 Assertion allows JSR223 script code to be used to check the status of the previous sample.
JSR223断言允许使用JSR223脚本代码去检查之前的取样的状态
使用场景:检查两个接口返回的值做比较来断言
JSR223断言的一些配置
//获取JSR223 Sample定义的urcic的值
def vurcic = vars.get(“urcic”);
//获取上一个sample定义的count
def vroomscount = vars.get(“count”);
log.info("-----------JSR223 Assertion 断言-------------");
log.info(vurcic);
log.info(vroomscount);
//判断urcic和count的值是否一致。并且根据断言结果做出提示
if(vurcic == vroomscount){
AssertionResult.setFailure(false);
AssertionResult.setFailureMessage(“ok”);
}
else{
AssertionResult.setFailure(true);
AssertionResult.setFailureMessag
Jmeter-JSR223全家桶-JSR223 断言
最新推荐文章于 2023-11-01 17:28:59 发布