newman: Running collection with packages results in `pm.require` is not a function

  1. Newman Version (can be found via newman -v): 6.1.2
  2. OS details (type, version, and architecture): Windows 10
  3. Are you using Newman as a library, or via the CLI? CLI through Powershell
  4. Did you encounter this recently, or has this bug always been there: First time trying
  5. Expected behaviour: To support the require function on pm. This is critical to our CI/CD integration testing.
  6. Command / script used to run Newman: newman run clients-api-collection.json -e cloud-dev-environment.json
  7. Sample collection, and auxiliary files (minus the sensitive details): 01. TypeError pm.require is not a function at test-script inside "[Test Setup] / CreateNewClient"
  8. Screenshots (if applicable): image

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Reactions: 21
  • Comments: 24

Most upvoted comments

The Library feature is almost useless for us currently, because we develop in postman and run in newman.

When is the package management feature in postman going to be supported in newman?

You forgot to mention that Postman CLI does not support packages with the free plan either.

Hi All,

Thanks for your feedback as always. Support for package library is not on the roadmap for Newman. However, we do support the package library feature on Postman CLI.

Please try out Postman CLI (command-line collection runner from Postman that supports similar functionalities as Newman). You can install it from here. Let us know your experience. If you would like to read more about similarities/differences between both the CLI tools, I can recommend this blog.

If you would like to talk with me on the call about your experience or challenges, here is a link to schedule a time.

Thanks, Malvika

We implemented this using UI with Postman and it’s a great feature to have a better maintainbility of the code. Having it in newman would be a great pro.

Any updates on this?

It’s a good feature, very helpful for improving the maintenance of the API tests but… on the automated side, using newman is mandatory to have this feature. I hope it will be available with newman usage also

Same for me. Thanks.

I mean, if you can’t use it using newman or postman-cli what’s the purpose of this feature?

I would also like to use this with newman since we use newman.

Some problem here. Upvoted!

It didn’t even cross my mind that newman wouldn’t support this!

Any timeframe for this to be implemented?

I’m having the same issue with the following info;

Newman Version (can be found via newman -v): 6.1.2 OS details (type, version, and architecture): Ubuntu 22.04.3 LTS Are you using Newman as a library, or via the CLI? CLI Did you encounter this recently, or has this bug always been there: First time trying Command / script used to run Newman: newman run ./PostmanDemo.postman_collection.json Sample collection attached: PostmanDemo.postman_collection.json Screenshot; Skærmbillede 2024-05-17 101027

Hello, thank you for your excellent work, and I agree, it would be really nice to have this feature, for better maintainability. Upvoted

Hi, could you prioritise it a little higher? please 😉

Same here, would be nice to have it in newman, too

Some problem, please implement in newman or postman-cli