-1

The postman collection is within a team workspace(not public), so unable to access the collection from newman via link. The use case here is- I have around 5 scripts in my collection and the output of the first script will be saved as a global variable and then used in the second script. Likewise, for all the following scripts. I am trying to automate this process to have it run from Newman.

Questions

  1. Can I access a collection (which is not in a public workspace) from Newman?
  2. I exported the collection and global variables in Json format. Is there an option in Newman commands to run the collection with global variables and ?
  3. Is Newman a good approach to automate such a use case?
Shar
  • 1
  • 3

1 Answers1

0

Can I access a collection (which is not in a public workspace) from Newman?

  1. You can generate a public json link for your collection even if its in a private workspace. Click share and choose via json link

  2. You can also export the collection as csv and then pass the csv file instead of the json url

I exported the collection and global variables in Json format. Is there an option in Newman commands to run the collection with global variables?

Read newman documentation :

https://www.npmjs.com/package/newman#newman-run-collection-file-source-options

-g , --globals Specify the file path or URL for global variables. Global variables are similar to environment variables but have a lower precedence and can be overridden by environment variables having the same name.

Is Newman a good approach to automate such a use case?

Newman is just a commandline utility that runs your collection , another way of automating this is using collection runner which is just a UI representation of what newman does

But newman is more beneficial due to the rich newman-htmlextra reporter as it gives lot of information on the test run .

You can also use monitor functionality but newman is the best way to approach it

PDHide
  • 18,113
  • 2
  • 31
  • 46
  • Thank you for your reply. You can generate a public json link for your collection even if its in a private workspace. "Click share and choose via json link" With this approach I am unable to access the global variables in the newman execution. The Json link is a snapshot only. – Shar Feb 06 '22 at 20:33
  • @Shar when you share collection , only collection is shared . similarly you have to share variables also . Currently you can only export and share it as json file only not as direct link – PDHide Feb 06 '22 at 21:07