Hi
I am facing some issues in collecting har data with the BrowserMob Proxy.
I cloned the latest BrowserMob Proxy and running the code as exactly written in Readme.md. However my har file is empty. Please help me in this regard
Details :- Latest Selenium + Browser Mob + Driver (on Mac)
Har Output :- {"log":{"version":"1.2","creator":{"name":"BrowserMob Proxy","version":"2.1.4","comment":""},"pages":[{"id":"
yahoo.com","startedDateTime":"2017-02-02T18:16:00.918Z","title":"
yahoo.com","pageTimings":{"comment":""},"comment":""}],"entries":[],"comment":""}}
Code :-
// start the proxy
BrowserMobProxy proxy = new BrowserMobProxyServer();
proxy.start(0);
// get the Selenium proxy object
Proxy seleniumProxy = ClientUtil.createSeleniumProxy(proxy);
// configure it as a desired capability
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(CapabilityType.PROXY, seleniumProxy);
// start the browser up
WebDriver driver = new FirefoxDriver(capabilities);
// enable more detailed HAR capture, if desired (see CaptureType for the complete list)
proxy.enableHarCaptureTypes(CaptureType.REQUEST_CONTENT, CaptureType.RESPONSE_CONTENT);
// create a new HAR with the label "
yahoo.com"
proxy.newHar("
yahoo.com");
// open
yahoo.com driver.get("
http://yahoo.com");
driver.findElement(By.id("UHSearchWeb")).click();
// get the HAR data
Har har = proxy.getHar();
HAR object trace image :-

Thanks,
Tarun