Time for action – starting the proxy - Selenium

We are going to need to start the proxy and make sure that we can then interact with it.

  1. Create a new Project in Intellij.

  2. Add the BrowserMob JARs to the project so that we can use it:

  3. When we want to stop the server we just call:

    proxy.stop()

What just happened?

We have successfully started the server by passing in the port. The server needs to be started before we can do any of the different tasks that we will be doing in future sections of the book.

Capturing network traffic

One of the most useful things in Selenium Remote Control is the ability to capture the network traffic of the application that you are testing. It was removed since it is not required to do browser automation, but it was nice to have.

To capture network traffic, we need to proxy all traffic through BrowserMob Proxy. The way that BrowserMob Proxy does this is by capturing the network traffic and pushing it into a format called HTTP Archive, or most commonly known as HAR. A HAR file is JSON format that is the standard way to represent network traffic.

HAR captures lot of information that can be used for different purposes, so we will learn how to capture it next.


All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Selenium Topics