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

805 views
Skip to first unread message

raghavendra reddy

unread,
Jun 6, 2012, 7:54:08 PM6/6/12
to BrowserMob Proxy
Hello,

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.

1) The Trends given by HAR Storage for these HAR files are:

With SWD+BM:
http://harstorage.com/results/details?label=http%3A%2F%2Fwww.stubhub.com%2Fsan-francisco-giants-tickets%2Fgiants-vs-rangers-6-8-2012-2032166%2F

With WPT: http://harstorage.com/results/details?label=page_1_0


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? Which one gives the best .HAR file to do the performance
analysis?

This is the code I used for SWD+BM:

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);
server.start();
server.setCaptureHeaders(true);
server.setCaptureContent(true);
// 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);

server.newHar("http://www.stubhub.com/san-francisco-giants-
tickets/giants-vs-rangers-6-8-2012-2032166/");


driver.get("http://www.stubhub.com/san-francisco-giants-
tickets/giants-vs-rangers-6-8-2012-2032166/");

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

}


Thanks,
Raghu.


raghu

unread,
Jun 7, 2012, 3:07:09 PM6/7/12
to browserm...@googlegroups.com
Hello,

I am new to BMP.

Does BMP passes all of the headers through or does it really proxies the requests? Just wondering if it honors the gzip encoding, etc.

Thanks,
Raghu.

Patrick Lightbody

unread,
Jun 13, 2012, 1:51:42 AM6/13/12
to browserm...@googlegroups.com
Raghu,
Yes it does. If you're going to post your question in three different places, can you at least link them to each other so that when people find your question in the archives they can follow the path to get all the answers:


raghu

unread,
Jun 13, 2012, 12:18:30 PM6/13/12
to browserm...@googlegroups.com
Hello Patrick,

Thanks for pointing it out will definitely do that.
Reply all
Reply to author
Forward
0 new messages