Is there a way to apply proxy configuration based on postman environment only?

Viewed 594

In the case when you have to test a resource in different environments you may use postman environment variables to specify environment specific values. However, if only some of the environments use proxy you have to set it up Postman settings and enable/disable it manually every time you run the test against that environment. It is annoying and lacks automation. It gets even worse if different environments use different proxies.

In addition when you export environments and collections proxy configuration stays in Postman. It is not exported. Therefore you have to document it somewhere in order to avoid loosing the configuration, since there is no comments for an environment to document it there.

The question is: is there a way to apply proxy configuration based on environment? For example, specifying some Postman environment variables.

1 Answers

I tried to specify HTTP_PROXY, HTTPS_PROXY environment variables in Postman. Unfortunately, it did not work. Probably I was misled by using ambiguous "environment variable" term in "Respect HTTP_PROXY, HTTPS_PROXY, and NO_PROXY environment variables." setting. Obviously, Postman in fact respects system environment variables.

I was able to use Proxy Bypass to specify all hosts I do not want to apply proxy configuration to. However, the list is pretty big in my case, since proxy required only for one environment. In addition it does not resolve the issue if multiple proxies need to be used.

Related