You can tunnel two different types of request through a proxy:
- connection between your test script and the browser driver (or WebDriver endpoint)
- connection between the browser and the internet
If your company has a corporate proxy (e.g. on
http://my.corp.proxy.com:9090) for all outgoing requests, follow the below steps to install and configure global-agent.
Add the following require statement to the top of your config file.
Before you start the test, make sure you've exported the variable in the terminal, like so:
You can exclude URLs from the proxy by exporting the variable, like so:
If necessary, you can specify
GLOBAL_AGENT_HTTPS_PROXY to route HTTPS traffic through a different proxy than HTTP traffic.
GLOBAL_AGENT_HTTP_PROXY is used for both HTTP and HTTPS requests if
GLOBAL_AGENT_HTTPS_PROXY is not set.
If you use Sauce Connect Proxy, start it via:
In order to tunnel the connection between the browser and the internet, you can set up a proxy which can be useful to (for example) capture network information and other data with tools like BrowserMob Proxy.
proxy parameters can be applied via the standard capabilities the following way:
For more information, see the WebDriver specification.