4

I am using newman nodejs library to run my collection How can I use an external javascript file (file present in same folder as the collection json) to use for prerequest script

my collection class where src value is the path to script file

"event": [ { "listen": "prerequest", "script": { "type": "text/javascript", "src": "library.js" } } ]

prateeksarda
  • 949
  • 1
  • 10
  • 15
  • Not sure that's possible. You could store your JS code into an (environment) variable. Then use `eval()` to execute that code. It's explained here in detail: https://blog.postman.com/api-testing-tips-from-a-postman-professional/#tip-5-reuse-code – Christian Baumann Sep 09 '20 at 09:11

0 Answers0