我想从POSTMAN的谷歌浏览器扩展中发送数据。我想用不同的数据发出10个请求,而且要在同一时间。
在POSTMAN中是否可以这样做?如果可以,谁能告诉我如何实现?
谢谢你的时间。
我想postman中没有运行并发测试的功能。
如果我是你,我会考虑Apache jMeter,它正是用于这种情况的。
关于Postman,唯一能或多或少满足你需求的是--Postman Runner。 ![在此输入图片描述][2] 。 在那里你可以指定细节。
这些运行不会是并发的,只是连续的。
希望这有帮助。但请考虑jMeter(你会喜欢它)。
Postman并没有这样做,但你可以在Bash中异步运行多个`curl'请求。
curl url1 & curl url2 & curl url3 & ...
记得在每个请求后面加一个&
,表示该请求应该作为一个异步作业运行。
不过Postman可以为你的请求生成curl片段:https://learning.getpostman.com/docs/postman/sending_api_requests/generate_code_snippets/
我不知道这个问题是否仍然相关,但现在在Postman中有这种可能性。他们在几个月前增加了这个功能。
你只需要创建简单的.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文件('node fileName.js'在cmd中)。
更多细节这里