1、添加BeanShell断言,在Script下面写断言脚本,常用的BeanShell脚本如下:

if(!SampleResult.getResponseCode().equals("200")){
    SampleResult.setSuccessful(false);
    log.error(SampleResult.getResponseCode());
}else{
    SampleResult.setSuccessful(true);
    log.info("测试成功!");
}

jmeter断言之BeanShell断言

2、添加断言结果,运行脚本

jmeter断言之BeanShell断言

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-06-21
  • 2021-09-07
  • 2021-12-02
  • 2022-02-12
  • 2022-12-23
  • 2022-02-20
猜你喜欢
  • 2021-08-14
  • 2022-03-08
  • 2021-11-08
  • 2021-08-15
  • 2021-07-21
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案