How to run a sub-folder in Postman

I have a collection and many of sub-folder in this collection, how can I run specific folder?
I tried with --folder parameter but it does not work

Hey @Xuyen,

Would you be able to provide some more implementation details and more clarification about what doesn’t work, please?

One of the ways that this might not work is if there were folders with the same name, this might not pick up the correct folder for the run.

Just to show you it working in the most basic way, I’ve created an example below.

If I have a Collection with the structure like this:

Screenshot 2020-02-29 at 08.51.19

Running Newman with the --folder F1 would run both sub-folders:

Running Newman with the --folder F1a would run that folder and the R1 request:

Running Newman with the --folder F1b would run that folder and the R2 request:

This can also work, if there was another sub-folder F1aa, inside the F1a sub-folder:

1 Like

Hi @dannydainton,

it works perfect with your solution. My wrong as provided the full path for sub-folder like F1/F1a…

Many thanks for your support!

Thanks,
Xuyen Tran

1 Like

Does this mean that all subfolders have to have unique names in order for you to target a specific subfolder (using --folder {sub-folderName})? I ask because with the way i have my collection structured, i have several subfolders containing duplicate names and it would be a real hassle to have to go back through each and every subfolder and re-name them to something unique. Why doesn’t postman provide the capability to simply provide the collection folder path to the subfolder in question??