Differences in .HAR files generated by selenium web driver with BrowserMob and webpag


I have generated .HAR files using Selenium Web Driver with BrowserMob Proxy(SWD+BM) and by using webpagetest.org(WPT). I used HAR Storage to view these files. The following are the differences I found.

a. All the sizes and times(Load Time, DNS Time, Transfer Time etc.) shown in SWD+BM are less compared to WPT.

b. No. of resources by request(images, css, html etc. ), resources by size, domains by request, domains by size in SWD+BM are less in number or equal to(mostly less) when compared to WPT.

I have used Firefox browser for the both.

Why are these differences? Is there any architecture difference b/w these two?

The code I used for BMP is:

import java.io.FileOutputStream;
import org.browsermob.core.har.Har;
import org.browsermob.proxy.ProxyServer;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.remote.CapabilityType;
import org.openqa.selenium.remote.DesiredCapabilities;

public class SeleniumWDBMHAR {

public static void main(String[] args) throws Exception {
// TODO Auto-generated method stub
ProxyServer server = new ProxyServer(4461);
// get the Selenium proxy object
org.openqa.selenium.Proxy proxy = server.seleniumProxy();
// configure it as a desired capability
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(CapabilityType.PROXY, proxy);

    // start the browser up
    WebDriver driver = new FirefoxDriver(capabilities);



    // get the HAR data
    Har har = server.getHar();
    String strFilePath = "Selenium_test.har";
    FileOutputStream fos = new FileOutputStream(strFilePath);



For the times I would fully expect WPT to be slower because we inject the traffic shaping to make it look like a DSL connection.

I’m not sure how the BrowserMob Proxy works but if the browser knows it is going through a proxy then it will radically change it’s connection behavior so things will look quite a bit different. Do you know if the BM Proxy passes all of the headers through or if it really proxies the requests? Just wondering if it honors the gzip encoding, etc.

Do you have Flash installed on your Firefox test agent?

Is all of the content guaranteed to be identical or are there ads or other content that could vary depending on location or time?

Are you using the same version of Firefox in both cases?

You’ll probably want to look at each individual resource to see if the content is the same and things are just counted slightly differently or if the content itself is different.



Hello Meenan,

Thanks for the reply.

The following are the answers to your questions

  1. I have to find out whether BMP proxies the requests. I am very new to this field.

  2. I have flash installed on my Firefox test Agent.

  3. yes the content changes depending on location and time.

  4. I haven’t used any Firefox settings in the code for BMP. I have Firefox 12 installed on my machine. In WPT, I have selected just Firefox I dont know what version it is.



I have posted the same question in other forums. Below are the links. You can find some more information here.