Api 如果响应给出440或未找到,如何在测试中调用另一个响应(get)
我将一个会话id设置为环境变量,当脚本给出440在测试中调用另一个请求的正确方法时,我需要替换该会话id您可以在测试中使用Api 如果响应给出440或未找到,如何在测试中调用另一个响应(get),api,web-services,postman,qa,web-api-testing,Api,Web Services,Postman,Qa,Web Api Testing,我将一个会话id设置为环境变量,当脚本给出440在测试中调用另一个请求的正确方法时,我需要替换该会话id您可以在测试中使用postman.setNextRequest()来指定下一步要运行的请求,请参阅 在你的情况下,你会有这样的东西: if (responseCode.code === 404) { postman.setNextRequest('<name of your other request>'); } if(responseCode.code==404){
postman.setNextRequest()
来指定下一步要运行的请求,请参阅
在你的情况下,你会有这样的东西:
if (responseCode.code === 404) {
postman.setNextRequest('<name of your other request>');
}
if(responseCode.code==404){
邮递员。setNextRequest(“”);
}