为Postman收藏设置超时

发布于 2025-01-24 14:58:31 字数 137 浏览 2 评论 0原文

我想在集合级别上启用超时的邮递员集合。 这个设置是否可以在邮递员的收集级别上进行? 我知道可以使用settimeout(()=> {},15000) 超时 ,但我找不到类似的东西来运行集合。

I want to run the Postman collection with timeout enabled at the collection level.
Is this setting possible at the collection level in Postman?
I know that the timeout can be set per request using setTimeout(() => {}, 15000), but I could not find something similar to run the collections.

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

池木 2025-01-31 14:58:31

单个呼叫的请求超时

Postman具有您在设置中手动设置的设置>一般>如果要设置明确的超时,请在MS中请求超时。但是,您将无法从脚本中做您想做的事情。

但是,您可以编写请求测试以确保您的响应时间
处于一定阈值。这样,当您运行请求时
如果测试要慢于800ms:

慢。

pm.test("Response time is less than 800ms", function () {
    pm.expect(pm.response.responseTime).to.be.below(800);
});

根据 https://community.postman.com/t/request timeout-for-single-call/6881/2

Request timeout for single call

Postman has a setting that you set manually in Settings > General > Request timeout in ms that you can set if you want to set an explicit timeout. However, you won’t be able to do what you’re trying to do from a script.

You can, however, write request tests to make sure your response times
are under a certain threshold. That way when you run the request, the
test will fail if it’s slower than say, 800ms:

pm.test("Response time is less than 800ms", function () {
    pm.expect(pm.response.responseTime).to.be.below(800);
});

According to https://community.postman.com/t/request-timeout-for-single-call/6881/2

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文