I want to use browsermob to monitor the network connections when doing a GUI test with selenium. I have found some information and documentation here and here and here, but
You need to configure the driver to use BMP as a proxy so it can record the network activity. Here is an example....
from browsermobproxy import Server
from selenium import webdriver
server = Server('/path/to/bmp/bin/browsermob-proxy') #Local path to BMP
server.start()
proxy = server.create_proxy() #Proxy is used to generate a HAR file containing the connection URLS that the MP3s are loaded from.
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument("--proxy-server={0}".format(proxy.proxy)) #Configure chrome options
driver = webdriver.Chrome(chrome_options=chrome_options)
proxy.new_har('filename')
Then all the activity will be recorded to that file.
In my case, the path for the binary file was C:\Python27\Lib\site-packages\browsermobproxy\browsermob-proxy-2.1.0-beta-3\bin\browsermob-proxy on Windows with Python 2.7