测试响应码状态是否为200:
pm.test("Status test", function () { pm.response.to.have.status(200); });
还可以使用pm.expect语法进行拓展
pm.test("Status test", function () {
pm.expect(pm.response.code).to.equal(200);
  pm.expect(pm.response.responseTime).to.below(200);
}];

检查响应主体中是否包含某字符串:
  pm.expect(res.date[0].id).to.eql(1);
});


相关文章:

  • 2021-11-12
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-07
  • 2021-08-01
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-06-30
  • 2021-09-28
  • 2022-12-23
  • 2021-12-23
  • 2021-11-27
  • 2021-10-03
相关资源
相似解决方案