Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
206 views
in Technique[技术] by (71.8m points)

Is there to run only part of requests in Postman?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

you can create folders and organize test like

  1. smoke_and_regression
  2. smoke_only etc

you can specify which folder to run using --folder arguent when using newman as command line tool

you can also control the execution flow using postman.setNextRequest .

and also you can run newman as an npm module.

you just need to write a logic to read the collection file and get all folder names containing "smoke" for eg and pass it as an array

const newman = require('newman'); // require newman in your project

 

// call newman.run to pass `options` object and wait for callback
newman.run({
    collection: require('./sample-collection.json'),
    reporters: 'cli',
    folder: folders
}, function (err) {
    if (err) { throw err; }
    console.log('collection run complete!');
});

Just update for the comments:

in old and new UI you can select which folder to execute in collection runner

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...