在以下代码中," LoopTillHealthy"被设置为下一个请求。
if (!(someValue && allGreen)) {
postman.setEnvironmentVariable("HEALTH_ITER", curIt+1);
if (parseInt(postman.getEnvironmentVariable("HEALTH_ITER"))<=maxIt) {
postman.setNextRequest("LoopTillHealthy");
}
} else {
tests["HEALTH CHECK AFTER "+postman.getEnvironmentVariable("HEALTH_ITER")+" calls"] = allGreen;
}
现在我可能在同一个集合中有多个文件夹,每个文件夹都包含自己的&#34; LoopTillHealthy&#34;的实现。 邮递员如何使用&#34; postman.setNextRequest&#34;从不同的文件夹中调用。
是否有类似的内容:
postman.setNextRequest(postman.getEnvironmentVariable("TARGET_FOLDER")+"\LoopTillHealthy");
,或者
postman.setNextRequest(postman.getEnvironmentVariable("TARGET_COLLECTION")+"\"+postman.getEnvironmentVariable("TARGET_FOLDER")+"\LoopTillHealthy");
答案 0 :(得分:3)
不幸的是,此刻不支持此功能。 官方邮递员支持Github有几个功能要求:
https://github.com/postmanlabs/postman-app-support/issues/2851 https://github.com/postmanlabs/postman-app-support/issues/2819