我想从邮差谷歌Chrome扩展POST数据。

我想用不同的数据提出10个请求,它应该是在同一时间。

在Postman中可以这样做吗?

如果是,谁能给我解释一下这是如何实现的?


当前回答

Runner选项现在位于面板的右下方

其他回答

Runner选项现在位于面板的右下方

如果您需要生成更多连续的请求(而不是快速单击SEND按钮)。你可以使用Runner。请注意,这不是真正的“并行请求”生成器。

File->新建Runner选项卡

现在,您可以从Collection中“拖放”您的请求,然后通过Runner设置10次迭代(生成10个请求)并延迟到0(以使其尽可能快),只检查您想要生成的请求。

在一个文件夹中并行运行所有Collection:

'use strict';

global.Promise = require('bluebird');
const path = require('path');
const newman =  Promise.promisifyAll(require('newman'));
const fs = Promise.promisifyAll(require('fs'));
const environment = 'postman_environment.json';
const FOLDER = path.join(__dirname, 'Collections_Folder');


let files = fs.readdirSync(FOLDER);
files = files.map(file=> path.join(FOLDER, file))
console.log(files);

Promise.map(files, file => {

    return newman.runAsync({
    collection: file, // your collection
    environment: path.join(__dirname, environment), //your env
    reporters: ['cli']
    });

}, {
   concurrency: 2
});

如果你只做GET请求,你需要在你的Chrome浏览器中另一个简单的解决方案,只需安装“打开多个url”扩展:

https://chrome.google.com/webstore/detail/open-multiple-urls/oifijhaokejakekmnjmphonojcfkpbbh?hl=en

我刚刚运行1500 url的一次,确实滞后谷歌一点,但它的工作。

您可以运行postman Runner的多个实例,并在每个实例中使用不同的数据文件运行相同的收集。