How to pass argument or value while running collection from newman

Ah-ha, I fell for the forum’s copy-and-paste bug myself. Was puzzling over why it wasn’t working, only to discover that I had been using the invalid curly-quotes from earlier examples. Once I literally straightened them out, it worked!

  • Bad: –global-var “k=v” ; // bad em-dash & curly-quotes
  • Good: --env-var "ev=5999222 ; // good double-minus & straight-quotes"

References:

  • issue 764 --global-var option added on Aug 22, 2017
  • issue 1799 --env-var option added in Newman v4.4.0.
1 Like