Skip to main content

Configuration recipes

Practical recipes for the most common TestingBot Tunnel configurations. Start with the basic setup, then add identifiers, headers, proxies and basic auth as your tests need them.

Getting started

Download the tunnel and start it from the command line.

java -jar testingbot-tunnel.jar key secret

Then update your test configuration to route traffic through the tunnel by changing the hub URL:

- urlhub = "https://key:secret@hub.testingbot.com/wd/hub"
+ urlhub = "http://key:secret@localhost:4445/wd/hub"

By connecting to localhost:4445, all test commands are routed through the tunnel to TestingBot.

Tunnel identifiers

Run multiple tunnels simultaneously and direct specific tests to a particular tunnel.

java -jar testingbot-tunnel.jar key secret -i myTunnel

Then specify the identifier in your test's desired capabilities:

{
  "browserName": "firefox",
  "browserVersion": "latest",
  "platformName": "WIN11",
  "tunnel-identifier": "myTunnel"
}

See running multiple tunnels for parallel and high-availability setups.

Custom headers

Inject custom HTTP headers into every request the tunnel makes. Useful for authentication tokens, feature flags, A/B test cookies and debugging headers.

java -jar testingbot-tunnel.jar key secret \
  --extra-headers '{"MyOwnHeader": "HeaderValue"}'

Upstream proxy

Route tunnel traffic through an upstream proxy server. Common use cases:

  • Corporate networks that require all outbound traffic to pass through a proxy.
  • Geo-location testing using HTTP proxies in different regions.

Use -Y for the proxy address and -z for credentials:

java -jar testingbot-tunnel.jar key secret -Y myproxy:9000 -z username:password

For PAC files and more advanced setups, see the upstream proxy guide.

Shared tunnels

Tunnels are private by default. Enable the --shared flag to make a tunnel available to other team members on the same TestingBot account.

java -jar testingbot-tunnel.jar key secret --shared

Team members can then run their tests against the shared tunnel without starting their own. Combine with --tunnel-identifier to give the shared tunnel a memorable name.

Basic authentication

Automatically supply credentials for websites that require HTTP Basic Authentication. The tunnel injects these credentials for matching hosts, so your tests do not have to handle authentication dialogs.

Use the -a flag with the format host:port:username:password. For standard HTTP sites use port 80:

java -jar testingbot-tunnel.jar key secret -a mywebsite.com:80:myusername:mypassword
Was this page helpful?
Last updated