Set Nightwatch’s Browser Proxy in Its Capabilities
Configure the browser’s manual proxy without confusing its page traffic with the test runner’s WebDriver connection.
Nightwatch runner → WebDriver service
automated browser → forward proxy → website
Configure the second path through the test environment's browser capability:
module.exports = {
test_settings: {
default: {
desiredCapabilities: {
browserName: 'chrome',
proxy: {
proxyType: 'manual',
httpProxy: 'proxy.example:8080',
sslProxy: 'proxy.example:8080',
},
},
},
},
};
Merge this with existing browser options and driver settings before session creation. The two host:port fields can name one HTTP proxy carrying both destination schemes; website URLs and TLS identity remain unchanged. Use a compatible HTTP entry from the HTTP proxy list for an allowed public-page test without proxy credentials; the address must be reachable from the browser host.
The runner's own WebDriver connection settings govern the first path, not browser preferences. If failure happens before a browser session exists, inspect that first connection.
For a remote driver, the proxy must be reachable from the browser host. A listener on the runner's localhost is not automatically available there.