我想从邮差谷歌Chrome扩展POST数据。
我想用不同的数据提出10个请求,它应该是在同一时间。
在Postman中可以这样做吗?
如果是,谁能给我解释一下这是如何实现的?
我想从邮差谷歌Chrome扩展POST数据。
我想用不同的数据提出10个请求,它应该是在同一时间。
在Postman中可以这样做吗?
如果是,谁能给我解释一下这是如何实现的?
当前回答
Runner选项现在位于面板的右下方
其他回答
Postman不会这样做,但你可以在Bash中异步运行多个curl请求:
curl url1 & curl url2 & curl url3 & ...
记住在每个请求后添加&,这意味着请求应该作为异步作业运行。
但是邮差可以为您的请求生成卷曲片段:https://learning.getpostman.com/docs/postman/sending_api_requests/generate_code_snippets/
如果你只做GET请求,你需要在你的Chrome浏览器中另一个简单的解决方案,只需安装“打开多个url”扩展:
https://chrome.google.com/webstore/detail/open-multiple-urls/oifijhaokejakekmnjmphonojcfkpbbh?hl=en
我刚刚运行1500 url的一次,确实滞后谷歌一点,但它的工作。
我不知道这个问题是否还有意义,但是现在在《邮差》中存在这样的可能性。他们几个月前加的。
你所需要的只是创建一个简单的.js文件,并通过node.js运行它。它是这样的:
var path = require('path'),
async = require('async'), //https://www.npmjs.com/package/async
newman = require('newman'),
parametersForTestRun = {
collection: path.join(__dirname, 'postman_collection.json'), // your collection
environment: path.join(__dirname, 'postman_environment.json'), //your env
};
parallelCollectionRun = function(done) {
newman.run(parametersForTestRun, done);
};
// Runs the Postman sample collection thrice, in parallel.
async.parallel([
parallelCollectionRun,
parallelCollectionRun,
parallelCollectionRun
],
function(err, results) {
err && console.error(err);
results.forEach(function(result) {
var failures = result.run.failures;
console.info(failures.length ? JSON.stringify(failures.failures, null, 2) :
`${result.collection.name} ran successfully.`);
});
});
然后运行这个.js文件(在cmd中'node fileName.js')。
详情请点击这里
在postman的收集运行器中,您不能同时进行异步请求,因此改用Apache JMeter。它允许您添加多个线程并添加同步计时器
不确定人们是否还在寻找简单的解决方案,但您可以在Postman中运行“Collection Runner”的多个实例。只需创建一个带有一些请求的运行器,并多次单击“运行”按钮来调出多个实例。