Hello, I have the question. Can I exclude collection's folder from newman runner iteration?

Hello, I have the question. Can I exclude collection’s folder from newman runner iteration?
It means can I, for example, in iteration 1 run all collection’s folders and in iteration 2 run n-1 collection’s folders?

I don’t think there is a way you can do that via straight command line arguments. But what you can do, is export your collection as json and make copies of it where you take out a folder at a time.

Then you can build a bat file or other scripts that executes the collections one after another. For example, if I had a weather API where I built a collection with folders to separate out different types of precipitation/conditions:
image

I could export the collection and name it ‘Rain_Snow_Clouds.json’.
I could then edit the json, take out the clouds folder and name the file ‘Rain_Snow.json’
Then I could edit the json again, take out the snow folder and name the file ‘Rain.json’

I could then build a script that runs newman three times:

newman run Rain_Snow_Clouds.json
newman run Rain_Snow.json
newman run Rain.json

This would get you what you are asking for.

However, this would be difficult to maintain in the long run because whenever you add/remove/change a request, you would have to re-export and do the process over again.

But if you’re looking for a proof of concept or temporary workaround, here you go :slight_smile:

You can do the opposite by passing the --folder option to newman run. You can choose the folders to execute manually, and newman will run only those. From the docs:

--folder <name>
Run requests within a particular folder/folders in a collection. 
Multiple folders can be specified by using --folder multiple times, like so: 
  --folder f1 --folder f2.

P.S. You can also try $ newman run -h to see all the options.