Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/api/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Api 如果响应给出440或未找到,如何在测试中调用另一个响应(get)_Api_Web Services_Postman_Qa_Web Api Testing - Fatal编程技术网

Api 如果响应给出440或未找到,如何在测试中调用另一个响应(get)

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){

我将一个会话id设置为环境变量,当脚本给出440在测试中调用另一个请求的正确方法时,我需要替换该会话id

您可以在测试中使用
postman.setNextRequest()
来指定下一步要运行的请求,请参阅

在你的情况下,你会有这样的东西:

if (responseCode.code === 404) {
    postman.setNextRequest('<name of your other request>');  
}
if(responseCode.code==404){
邮递员。setNextRequest(“”);
}