No output HAR file

44 views
Skip to first unread message

Zhenyu Zhou

unread,
Apr 10, 2015, 1:13:00 AM4/10/15
to fir...@googlegroups.com
Hello, 

I'm trying using firebug+netExport to generate HAR files automatically. Although I can run the program without exception, there is no output file in the output directory. Could you please help me out? 

Here is the code (slightly modify from the one in tutorial):

package wpt;


import java.io.*;

import java.lang.InterruptedException;

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.firefox.FirefoxDriver;

import org.openqa.selenium.firefox.FirefoxProfile;


public class Test

{

public static void main(String[] args) throws IOException

{

FirefoxProfile profile = new FirefoxProfile();


File firebug = new File("/Users/zzy/Documents/eclipse/WPT/bin/firebug-3.0.0-alpha.9.xpi"); // ("firebug-2.0.8-fx.xpi");

File netExport = new File("/Users/zzy/Documents/eclipse/WPT/bin/netExport-0.9b7.xpi");


try

{

profile.addExtension(firebug);

profile.addExtension(netExport);

} catch (IOException err)

{

System.out.println(err);

}


// Set default Firefox preferences

profile.setPreference("app.update.enabled", false);


String domain = "extensions.firebug.";


// Set default Firebug preferences

profile.setPreference(domain + "currentVersion", "3.0");

profile.setPreference(domain + "allPagesActivation", "on");

profile.setPreference(domain + "defaultPanelName", "net");

profile.setPreference(domain + "net.enableSites", true);


// Set default NetExport preferences

profile.setPreference(domain + "netexport.alwaysEnableAutoExport", true);

profile.setPreference(domain + "netexport.showPreview", false);

profile.setPreference(domain + "netexport.defaultLogDir",

"/Users/zzy/Documents/har/");


WebDriver driver = new FirefoxDriver(profile);


try

{

// Wait till Firebug is loaded

Thread.sleep(5000);

// Load test page

driver.get("http://www.facebook.com");


// Wait till HAR is exported

Thread.sleep(10000);


} catch (InterruptedException err)

{

System.out.println(err);

}


driver.quit();

}

}


I'm sure the output path, ie. /Users/zzy/Documents/har/, is spelled correctly. To be honest, I make it to generate HAR files several months ago. But now all softwares, including firefox, selenium, firebug and netExport, are updated and they don't work any more....

My version is:
firefox - 37.0.1 (latest)
selenium - 2.45.0 (may be latest)
firebug - 3.0.0-alpha.9 (latest)
netExport - 0.9b7 (latest)

When I run this program, the firefox will pop up and load the Facebook page successfully. But no developer console appears as before (I remember the console will show up automatically before). Then the program terminates and I get no outputs.

Does anyone have insight into this problem? Any hints are appreciate.

Many thanks!

Zhenyu

Jan Honza Odvarko

unread,
Apr 10, 2015, 1:22:28 AM4/10/15
to fir...@googlegroups.com

Senthil

unread,
Apr 10, 2015, 8:50:05 AM4/10/15
to fir...@googlegroups.com
The value for the domain variable has changed with 3.0. The domain value should be as below

Also to bring up the network panel, you should use 
        profile.setPreference("devtools.toolbox.selectedTool", "netmonitor"); //The net panel is selected by default
        profile.setPreference("devtools.netmonitor.enabled", true);  //Net panel is enabled by default

There is a project attached with the below thread - you can use that as reference

Zhenyu Zhou

unread,
Apr 10, 2015, 11:18:12 AM4/10/15
to fir...@googlegroups.com
Oh I see. I have found 'window.NetExport.trigger("secretcode")' in that thread and thought it was a js. discussion... Sorry about that.

And one more question, I want to detect the time for ssl as well, but the output only contains:
        "timings": {
          "blocked": 0,
          "dns": 0,
          "connect": 109,
          "send": 0,
          "wait": 154,
          "receive": 41
        }

Other HAR files, such as the one get from pingdom (http://tools.pingdom.com/fpt/), may contain "ssl" filed in this "timings" array.

Moreover, if I load https://www.facebook.com, I'll get the following message in the developer console:
This site makes use of a SHA-1 Certificate; it's recommended you use certificates with signature algorithms that use hash functions stronger than SHA-1.

Does Firebug support ssl so far? If so, how can I measure the time for security connection?

Thanks!

Zhenyu Zhou

unread,
Apr 10, 2015, 11:24:39 AM4/10/15
to fir...@googlegroups.com
Hi Senthil,

Yes you are right, now it works after modifying the domain! Thanks a ton for your help!

And I'm wondering whether I can get the ssl time by firebug? In more detail, please see my response to Honza above. The "timings" doesn't contain "ssl" field in the output HAR files.

Thanks again for your help!

Zhenyu
Reply all
Reply to author
Forward
0 new messages