4

I have defined several Postman test collections/folders and their associated test data files. Running them through Postman Collection Runner and Newman individually works fine. I wanted to batch multiple runs together, like this .bat in Windows:

SET postman_collection=Regression.postman_collection.json
SET postman_environment=Development.postman_environment.json

SET postman_folder="Order details"
SET postman_data="orders.json"
newman run %postman_collection% -r html,cli -e %postman_environment% --folder %postman_folder% -d %postman_data%

SET postman_folder="Fuzzy Search"
SET postman_data="fuzzy search regression.csv"
newman run %postman_collection% -r html,cli -e %postman_environment% --folder %postman_folder% -d %postman_data%

SET postman_folder="Sorting"
SET postman_data=""
newman run %postman_collection% -r html,cli -e %postman_environment% --folder %postman_folder% -d %postman_data%

However, execution ends after the first newman run completes. I think it terminates the console for some reason.

How can I achieve what I want to do above? Am I structuring my tests incorrectly? Any help is appreciated!

karel
  • 5,489
  • 46
  • 45
  • 50
zemien
  • 562
  • 6
  • 17

1 Answers1

4

You just have to use "call" before newman command as follows:

SET postman_collection=Regression.postman_collection.json
SET postman_environment=Development.postman_environment.json

SET postman_folder="Order details"
SET postman_data="orders.json"

call newman run %postman_collection% -r html,cli -e %postman_environment% --folder %postman_folder% -d %postman_data%

SET postman_folder="Fuzzy Search"
SET postman_data="fuzzy search regression.csv"

call newman run %postman_collection% -r html,cli -e %postman_environment% --folder %postman_folder% -d %postman_data%
STF
  • 1,485
  • 3
  • 19
  • 36
Chandru
  • 41
  • 2