FirefoxProfile profile = new FirefoxProfile();
profile.addExtension(new File("D:\\suman\\firebug-2.0.8-fx.xpi"));
profile.addExtension(new File("D:\\suman\\netExport-0.9b6.xpi"));
profile.setEnableNativeEvents(true);
profile.setPreference("extensions.firebug.netexport.pageLoadedTimeout", 0);
profile.setPreference("extensions.firebug.currentVersion", "3.0.0");
profile.setPreference("extensions.firebug.defaultPanelName", "net");
profile.setPreference("extensions.firebug.net.enableSites", true);
profile.setPreference("extensions.firebug.allPagesActivation", "on");
profile.setPreference("extensions.firebug.showFirstRunPage", false);
profile.setPreference("extensions.firebug.netexport.defaultLogDir", "D:\\sumanHAR FIle");
profile.setPreference("extensions.firebug.netexport.saveFiles", true);
profile.setPreference("extensions.firebug.netexport.alwaysEnableAutoExport", true);
profile.setPreference("extensions.firebug.netexport.includeResponseBodies", false);
profile.setPreference("extensions.firebug.netexport.exportFromBFCache", true);
profile.setPreference("extensions.firebug.netexport.secretToken", "abcd");
profile.setPreference("extensions.firebug.netexport.showPreview", false);
profile.setPreference("extensions.firebug.net.defaultPersist", true);
profile.setPreference("extensions.firebug.console.defaultPersist", true);
capabilities.setCapability(FirefoxDriver.PROFILE, profile);
driver = new FirefoxDriver(capabilities);
driver.manage().window().maximize();
driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);
At end of test method
---------------------
JavascriptExecutor js= (JavascriptExecutor)driver;
js.executeScript("window.NetExport.triggerExport('abcd')");