Working with BrowserMob Proxy
Patrick Lightbody, one of the core originators of Selenium and the creator of Selenium RC with Paul Hammant, created the BrowserMob proxy while working on his start-up, BrowserMob. BrowserMob Proxy allows you to control the way traffic is filtered to the browser.
We can also change the headers that are supplied to the server. This allows us to do a number of things.
Creating and starting a proxy
When working with BrowserMob Proxy, we will need to make sure that we start the proxy so that we can use the API and change what we need.
We will need to start the proxy and make sure that we can then interact with it:
- Create a new Project in IntelliJ.
- Add the BrowserMob JAR files to the project so that we can use it:
ProxyServer proxy = New ProxyServer(9876); proxy.start();
- When we want to stop the server, we just call the following method:
proxy.stop()
We successfully started the server by passing in the port. The server needs to be started before we can do any of the different...