SetNextrequest的Postman脚本不起作用

发布于 2025-02-08 07:28:43 字数 590 浏览 1 评论 0原文

我正在使用 https://learlearning.postman.com/docs/docs,我正在使用示例/运行汇款/building-workflows/

我的请求名为“ mytestrequest”。这是邮政请求。在请求的“测试”选项卡中,我有以下代码:

var i = 0;
while (i < 3) {
  postman.setNextRequest("MyTestRequest");
  console.log("Iteration:" + i);
  i++;
}

当我单击“发送”按钮时,我应该看到四个帖子请求。第一篇文章甚至在执行上述代码之前就会发生。

但是,我只看到一个邮政请求。尽管我确实看到了三个控制台日志线,但是SetNextrequest似乎没有做任何事情。

我的代码与文档中的示例没有什么不同。想知道是否有人有任何见识。谢谢。

I am using a sample from https://learning.postman.com/docs/running-collections/building-workflows/.

My request is named "MyTestRequest." It is a POST request. In the "Tests" tab of the request, I have the following code:

var i = 0;
while (i < 3) {
  postman.setNextRequest("MyTestRequest");
  console.log("Iteration:" + i);
  i++;
}

When I click on the Send button, I should be seeing four POST requests. The first POST happens even before the above code gets executed.

However, I see only one POST request. Although I do see three console log lines, it appears setNextRequest is not doing anything.

My code is no different than the example in the document. Wondering if anyone has any insight. Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文