TestingBot Blog

TestingBot provides a cloud of browsers and devices, ready to run your Automated, Live and Visual tests.

< Back to Blog Overview

BrowserMob Proxy Tutorial

2012-05-17

Today we have added support for using a BrowserMob proxy together with our Selenium grid.


By using this proxy, you can manipulate HTTP traffic during your tests, and do some other cool things too:

We provide a private and secure proxy for every customer, free of charge. The traffic flowing through this proxy will only be available to you.


Below is an example on how to start and use a proxy.

Starting a new Proxy

To start a proxy, please make a GET request to our API: curl -u API_KEY:API_SECRET http://api.testingbot.com/v1/tunnel

We will boot up a pristine virtual machine for you, which should take no longer than 45 seconds. Once the machine is booted, make the same request again to obtain the IP address of your personal VM. Now that you have the IP, you can start using the proxy and do some interesting things.

Use the proxy

In this example, we'll capture performance data in a HAR file for a single Selenium test in Ruby.


Start off by creating a listener on a free port: curl -X POST http://IP:9090/proxy


This call will return a free port (for example 9091), which you need to use in your test.


Also, create a HAR attached to the port you obtained: curl -X PUT http://IP:9090/proxy/9091/har


Now run the test with your proxy:


When the test has finished running, you can fetch the HAR file from your personal proxy: curl http://IP:9090/proxy/9091/har


We have added a page in our support area with this BrowserMob proxy example.


Should you have any questions about this, please let us know in the comments or contact us.

< Back to Blog Overview

Sign up for a Free Trial

Start testing your apps with TestingBot.

No credit card required.