Running the Same Collection with Multiple Test Data JSONFile

Running the Same Collection with Multiple Test Data Files

  • Introduce The Question: I’m currently working on a project where I need to run a Postman collection with different sets of test data JSON files. However, I’m unsure about the best approach to achieve this efficiently. I’ve tried manually uploading each test data file before running the collection, but this process is time-consuming and prone to errors. I’m seeking guidance on how to automate the process of running the same collection with multiple test data files and can it generate the multiple test runs.

I am using Newman. Help me on this

Hi @ashwinijyotik25. Welcome to the Postman Community.

I see you’re already using Newman to run the collection against specific data files on the command line. Are you looking to run it against other data files sequentially immediately after the previous runs?

Hi @gbadebo-bello I am seeking to execute the data files sequentially right after the preceding runs."

Okay. Newman does not inherently provide this feature, but you can achieve this using specific scripting commands on the CLI.

You can use the && operator to have multiple commands run in parallel. For example

newman run Collection1.postman_collection.json && newman run Collection2.postman_collection.json

Will run collection 1 and collection 2 sequentially. This way, you can pass separate data files into collection 1 and collection 2

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.