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.