0

I have a line like pm.collectionVariables.set("blah", jsonData.someField) in my Tests tab for a request.

It sets the collection variable fine if I run the request in the workspace, but not if I run a Collection Run.

That is, when I run the collection as a "Collection Run", the collection variable is not changed. (!)

Is this right? Do I need to change the variable to be an environment variable?

Guy
  • 666
  • 1
  • 10
  • 34
  • Is the request saved before running the Collection? The runner won't pick up the changes if it's not. – Danny Dainton Jan 15 '20 at 13:33
  • @DannyDainton - Pretty sure I did, but I'll make sure to try again. One thing that I think helped was just to tick the checkmark to save variables. – Guy Jan 15 '20 at 14:12
  • @Guy, when you say _tick the checkmark to save variables_, I guess you mean that in the **Collection Runner** you check **Keep variable values**? – Henke Jan 27 '21 at 10:55
  • @henke - This question is a year old, but thanks for getting back. I can close this question, but I think the answer is yes. – Guy Jan 28 '21 at 12:29

0 Answers0