BrowserMob Proxy

We offer support for the BrowserMob proxy version 2.12 (updated August 16, 2016), which allows you to manipulate HTTP traffic during your Selenium tests.

By using this proxy you can
  • Set get http headers during your tests
  • Capture performance data with har files
  • Simulate network traffic and latency
  • Rewrite http requests and respones

We provide a private and secure proxy which works together with our grid and only you can access
To get started please follow the example below

Starting the proxy

To start the proxy make a get request to our api like this
curl -u key:secret

The first time you initiate this request we boot up a pristine virtual machine for you which only you can access
The response of this call will have a pending state which means a server is being started for you


The average boot time is 45 seconds to check the status of your machine please use this command replace 7977 with the id you received in the previous call
curl -u key:secret

The state should soon be ready in the response you will find your personal server ip

You can now use this personal ip in this example as your BrowserMob proxy the port will always be 9090

Using the proxy

Please see the Readme file on GitHub for all of the BrowserMob proxy's commands.
An example where we will collect performance data in a HAR file together with a Selenium test run by ruby would be

Create a new proxy by making this request to your personal IP Replace with the IP you received:
curl -X POST

In the response you will receive a port which you can use as proxy
For this example we will assume the returned port is 9091

Now create a HAR attached to the proxy we just created
curl -X PUT

Run your test
#!/usr/bin/env ruby
require "rubygems"
require 'testingbot'
gem "selenium-webdriver"
require "selenium-webdriver"

caps = {
  :browserName => "firefox",
  :version => "10",
  :platform => "WINDOWS",
  :proxy => => "") #use the 9091 port and personal ip we retrieved earlier

urlhub = ""
client =
client.timeout = 120

@webdriver = Selenium::WebDriver.for :remote, :url => urlhub, :desired_capabilities => caps, :http_client => client ""
puts @webdriver.title
Once the test has finished you can obtain the har file from your proxy

Use browsermob with our tunnel

The good thing about the Browsermob proxy is that you can specify an upstream proxy, meaning we can use the Browsermob proxy in our tests and set its upstream proxy to our Tunnel.

So to start this process heres what should happen

  1. Start a tunnel with the java -jar testingbot-tunneljar
  2. Wait until the tunnel is ready
  3. Fetch its private IP via cURL:
    curl -u key:secret
  4. This should return something like:
  5. Use the private_ip as upstream proxy with Browsermob:
    curl -X POST "http://[ip]:9090/proxy?httpProxy=[private_ip]:2009"
  6. This will return a port for example 9092
  7. Start recording the traffic in HAR format:
    curl -X PUT -d 'initialPageRef=Foo' http://[ip]:9090/proxy/9092/har
  8. Run your test with proxy 10968162162 and port 9092
  9. When test is done, collect HAR results:
    curl http://[ip]:9090/proxy/9092/har