I have a collection of tests and use a data file to run those tests. It seems cumbersome I have to select the same file each time before running the collection. Is there a way to save the data file selection as part of the collection? Thanks for any pointer.
Hi @bebemau !
Postman does not currently support a way to permanently associate a data file with a collection. Each time you use the runner, you’ll have to select the data file manually.
However, there are some potential workarounds:
- Use Postman’s CLI or Newman : Newman is Postman’s command-line companion tool. With Newman, you can run a collection with a specified data file using a single command. This way, you can script or create a shortcut to run your collection without selecting the data file each time.
newman run <Collection_Name>.json -d <Data_File_Name>.json
- Environment Variables: If your data file isn’t too large and changes infrequently, you might consider setting up environment variables with the required data. This way, the data would be associated with the environment rather than requiring an external file.
- Bookmark or Shortcut: If you’re accessing the data file from a consistent location, you might create a shortcut or bookmark to that location, so it’s faster to access and select when needed.
- Feature Request: Postman values user feedback, and feature requests help us understand user needs. You might consider submitting this as a feature request on the Postman GitHub repository, as this can draw attention to the need and potentially expedite its development based on user demand.
Hope this helps! If you have any other questions or concerns, feel free to reach out
Thank you for confirming there is no way to do so in the UI since I felt like i must be missing something. Sounds like cli is the most viable option for now since our data files can be big.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.