Postman collection test execution using newman

Hi All

My postman collection tests are executed using newman. It is working fine. Package.json has 2 newman executions using the same collections. First one uses html extra report and creates results in HTML format using hbs template.

Second one is junit report using the same collection. I would like to add wait in between the first and second newman tests. Meaning I want the second suite to be executed after completing the first one. Here is a code snippet from package.json. Thanks.

"testA": “newman run collections/xyx.json -e collections/env.json -r htmlextra --reporter-htmlextra-export results.html --timeout-request 4000 --reporter-htmlextra-template test.hbs”,
"testB-Junit": “newman run collections/xyx.json -e collections/env.json --reporter-junit-export results.xml --reporters cli,junit”,

Hey @rjayaram,

Is there a reason that you couldn’t combine them and have a single command that does all those things?

Hi Danny

I would like to create 2 different reports. One is HTML and another one is Junit. I am not sure if I can combine these 2. Let me know if I can still create 2 different reports by combining. Should I just add additional reports in the first command itself?

Thanks

You should be able to do something like this:

"combinedTest": “newman run collections/xyx.json -e collections/env.json --timeout-request 4000 -r cli,junit,htmlextra --reporter-junit-export results.xml --reporter-htmlextra-export results.html --reporter-htmlextra-template test.hbs"

I haven’t tried it so I don’t know for sure :grin:

1 Like

Hi Danny,

It worked :smile: Thanks. In this case it is the same collection. if we have 2 (or 3) different collection and if we want to execute second suite after completing the first one, is there a way to give wait time so that second one will be executed after completing first one? If that is not possible, I will go with Jenkins chain jobs (downstream/ upstream jobs) .
Also I would like to know with my original set up (2 tests one generates junit report and another one generates HTML), does newman execute those 2 in parallel or one after another?

Thanks