jeudi 11 janvier 2018

Modify enviroment with tests while running Postman Newman in NodeJS

I'm running Newman in a Node Script. But the collection has enviroment variables such as that would increment with each post by the test.

Example:

I have this collection body

 <ClaimIdentification>
      <company>0001</company>
      <office>100</office>
      <claimNum></claimNum>
 </ClaimIdentification>

And in the global enviroment JSON:

  {
  "enabled": true,
  "key": "claimNum",
  "value": "15200",
  "type": "text"
},

And the collection has this test:

pm.globals.set(\"claimNbr\", +pm.globals.get(\"claimNbr\") + 1);

But when ran in the script, the global.json file won't be modified and the "value" would stay the same. When this same parameters are run in the desktop app, it works.

¿Is there a solutions for this, should this work?

Aucun commentaire:

Enregistrer un commentaire