Search code examples
postmannewman

How to clean up all environment variable from a respective env. in postman/newman


I have written tests in postman.

Now I want to clean up all env variable once my script complete.

I do not want to clear them one by one using the below command:

postman.clearEnvironmentVariable("key");

Is there any command who will clear all my env variable keys as a clean up process without deleting my environment.


Solution

  • you may have a look here and try with pm.globals.clear() or pm.environment.clear()

    hope this helps