Firebug + NetExport does not auto export Har file

1,307 views
Skip to first unread message

Arie Hoenel

unread,
Dec 16, 2014, 4:20:24 AM12/16/14
to fir...@googlegroups.com
Hi

I'm trying during Selenium tests to export net console to Har file.
My configuration is: FF 34.0.5 + Firebug 2.0.7 + netExport-0.9b6

here my code:

FirefoxProfile profile = new FirefoxProfile();

if (cleanHarFile()) {
File firebug = new File(System.getProperty("user.dir") + "/src/test/resources/firebug-2.0.7.xpi");
File netExport = new File(System.getProperty("user.dir") + "/src/test/resources/netExport-0.9b6.xpi");

try {
profile.addExtension(firebug);
profile.addExtension(netExport);
} catch (IOException e) {
e.printStackTrace();
}

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

//Setting Firebug preferences
profile.setPreference("extensions.firebug.currentVersion", "2.0.7");
profile.setPreference("extensions.firebug.addonBarOpened", true);
profile.setPreference("extensions.firebug.console.enableSites", true);
profile.setPreference("extensions.firebug.script.enableSites", true);
profile.setPreference("extensions.firebug.net.enableSites", true);
profile.setPreference("extensions.firebug.previousPlacement", 1);
profile.setPreference("extensions.firebug.allPagesActivation", "on");
profile.setPreference("extensions.firebug.onByDefault", true);
profile.setPreference("extensions.firebug.defaultPanelName", "net");
profile.setPreference("extensions.firebug.netFilterCategories", "image");
profile.setPreference("extensions.firebug.net.logLimit", "3000");
 
            // Setting netExport preferences
profile.setPreference("extensions.firebug.netexport.alwaysEnableAutoExport", true);
profile.setPreference("extensions.firebug.netexport.showPreview", false);
profile.setPreference("extensions.firebug.netexport.pageLoadedTimeout", 0);
profile.setPreference("extensions.firebug.netexport.secretToken", "harFile");
profile.setPreference("extensions.firebug.netexport.defaultLogDir", HARFILEDIR);
profile.setPreference("extensions.firebug.netexport.saveFiles", true);

during my test I'm calling

js.executeScript("window.NetExport.triggerExport(\"harFile\")");

but NO Har file is saved and getting: TypeError: window.NetExport is undefined

Can some one help me ?

Thanks

Sebastian Zartner

unread,
Dec 18, 2014, 1:52:13 AM12/18/14
to fir...@googlegroups.com, Jan Odvarko
Honza, can you help out here?

Sebastian

Arie Hoenel

unread,
Jan 6, 2015, 3:46:39 AM1/6/15
to fir...@googlegroups.com, odv...@gmail.com
Honza ??? I'm stuck in my work because this issue....

thanks for your help !

Jan Honza Odvarko

unread,
Jan 6, 2015, 12:38:18 PM1/6/15
to fir...@googlegroups.com, odv...@gmail.com
I'll take a look at it tomorrow.
(I got back from my vacation yesterday)

Honza

Katy Dayan

unread,
Jan 8, 2015, 2:44:23 AM1/8/15
to fir...@googlegroups.com, odv...@gmail.com
I have the similar issue(+ConsoleExport)

Can you please help?
Thanks!!!

вторник, 6 января 2015 г., 19:38:18 UTC+2 пользователь Jan Honza Odvarko написал:

Jan Honza Odvarko

unread,
Jan 8, 2015, 6:02:23 AM1/8/15
to fir...@googlegroups.com, odv...@gmail.com
I created a bug report for this here:
https://github.com/firebug/netexport/issues/16

I don't know how to easily reproduce the problem, but I created and committed
a patch at https://github.com/firebug/netexport/commit/d096cbc681cb0dae58a1691cd2963824d74d24c1

Can you git clone https://github.com/firebug/netexport.git
and give it a try?

Honza

Arie Hoenel

unread,
Jan 8, 2015, 7:03:59 AM1/8/15
to fir...@googlegroups.com, Jan Odvarko
Hi

Thanks for this fix.
Can you please tell me how to create a xpi file to check it ?


--
You received this message because you are subscribed to a topic in the Google Groups "Firebug" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/firebug/POY5S7xuzqY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to firebug+u...@googlegroups.com.
To post to this group, send email to fir...@googlegroups.com.
Visit this group at http://groups.google.com/group/firebug.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebug/78f88dd2-7639-48c2-8af6-3beb1ebaa512%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Arie Hoenel

unread,
Jan 11, 2015, 10:58:33 AM1/11/15
to fir...@googlegroups.com, Jan Odvarko
Hi Honza

I tried your patch.
I can run the action "window.NetExport.triggerExport("harFile")" without getting any errors, but it did not save any HAR file when I run by Selenium.
When I try manually, I'm running the same action and CAN save HAR file.

Do you have any idea ?

Thanks
Arie

Jan Honza Odvarko

unread,
Jan 12, 2015, 3:14:50 AM1/12/15
to fir...@googlegroups.com, odv...@gmail.com
I don't have Selenium installed and setup on my machine,
but perhaps you could try to install FBTrace?
https://getfirebug.com/wiki/index.php/FBTrace

Download for Firebug 2:
https://getfirebug.com/releases/fbtrace/2.0/

Check DBG_NETEXPORT option in the Options tab,
start your scenario, collect all the logs, export the log to a file
(Tools -> Save To File, *.ftl) and send it to me
(make sure there are no sensitive data in the log)

I can consequently analyze the log and try to
figure out the problem.

Honza
To unsubscribe from this group and all its topics, send an email to firebug+unsubscribe@googlegroups.com.

To post to this group, send email to fir...@googlegroups.com.
Visit this group at http://groups.google.com/group/firebug.

Tim Koa

unread,
Jan 12, 2015, 5:12:09 AM1/12/15
to fir...@googlegroups.com, odv...@gmail.com
Good day, 

I'm also encountering this issue; attached the FBTracing logs...
I've set these on my profile: 
                                    myProfile.SetPreference("extensions.firebug.netexport.secretToken", "abcde");
                                    myProfile.SetPreference("extensions.firebug.netexport.alwaysEnableAutoExport", true);
                                    myProfile.SetPreference("extensions.firebug.netexport.autoExportToFile", false);
                                    myProfile.SetPreference("extensions.firebug.netexport.autoExportToServer", false);
                                    myProfile.SetPreference("extensions.firebug.netexport.defaultLogDir", DownloadPath);
                                    //myProfile.SetPreference("extensions.firebug.netexport.showPreview", true);
                                    myProfile.SetPreference("extensions.firebug.netexport.sendToConfirmation", false);
                                    myProfile.SetPreference("extensions.firebug.netexport.pageLoadedTimeout", 0);
                                    myProfile.SetPreference("extensions.firebug.netexport.Automation", true);

Triggering the Javascript via Firebug Console: window.NetExport.triggerExport("abcde");
That returns as undefined, my NetExport is taken from the latest copy in GIT.

Many Thanks,
Tim
To unsubscribe from this group and all its topics, send an email to firebug+u...@googlegroups.com.

To post to this group, send email to fir...@googlegroups.com.
Visit this group at http://groups.google.com/group/firebug.
firebug-tracing-logs.ftl

Arie Hoenel

unread,
Jan 12, 2015, 5:22:56 AM1/12/15
to fir...@googlegroups.com, Jan Odvarko
here my file from manual test, not by selenium cause it failed to load webdriver + Trace page (I probably not configure right the FF profiles)

I needed to deactivate the autoexport and then activate it manually to get option to do window.NetExport.triggerExport("harFile") see line 958


firebug-tracing-logs.ftl

Jan Honza Odvarko

unread,
Jan 13, 2015, 8:10:35 AM1/13/15
to fir...@googlegroups.com, odv...@gmail.com


On Monday, January 12, 2015 at 11:12:09 AM UTC+1, Tim Koa wrote:
Good day, 

I'm also encountering this issue; attached the FBTracing logs...
I've set these on my profile: 
                                    myProfile.SetPreference("extensions.firebug.netexport.secretToken", "abcde");
                                    myProfile.SetPreference("extensions.firebug.netexport.alwaysEnableAutoExport", true);
                                    myProfile.SetPreference("extensions.firebug.netexport.autoExportToFile", false);
                                    myProfile.SetPreference("extensions.firebug.netexport.autoExportToServer", false);

You have both
autoExportToFile and autoExportToServer set to false, so nothing get exported.

If you set e.g. autoExportToFile to true, you should see results in the specified target download directory.

Honza


Jan Honza Odvarko

unread,
Jan 13, 2015, 8:13:48 AM1/13/15
to fir...@googlegroups.com, odv...@gmail.com
So, I  can see from the log that the HAR file got exported to:
C:\Development\testautomation\target\har\player.anyclip.com+2015-01-12+12-07-15.har

Honza

Arie Hoenel

unread,
Jan 13, 2015, 8:25:22 AM1/13/15
to fir...@googlegroups.com, Jan Odvarko
I had it as true in my test.

I just run again my tests and got org.openqa.selenium.WebDriverException: window.NetExport is undefined
but I have no FBTrace...

--
You received this message because you are subscribed to a topic in the Google Groups "Firebug" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/firebug/POY5S7xuzqY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to firebug+u...@googlegroups.com.

To post to this group, send email to fir...@googlegroups.com.
Visit this group at http://groups.google.com/group/firebug.

Arie Hoenel

unread,
Jan 13, 2015, 8:32:49 AM1/13/15
to fir...@googlegroups.com
if I'm doing same actions manually 

config
Images intégrées 1

running action window.NetExport.TriggerExport("harFile") return undefined error
deactivate autoExport then activate it again fix the problem and then export the file, here the Trace

firebug-tracing-logs.ftl

Jan Honza Odvarko

unread,
Jan 13, 2015, 8:51:28 AM1/13/15
to fir...@googlegroups.com, odv...@gmail.com


On Tuesday, January 13, 2015 at 2:25:22 PM UTC+1, Arie Hoenel wrote:
I had it as true in my test.

I just run again my tests and got org.openqa.selenium.WebDriverException: window.NetExport is undefined
but I have no FBTrace...
FBTrace 2 for Firebug 2
https://getfirebug.com/releases/fbtrace/2.0/

Make sure you are using latest NetExport 0.9b7
https://getfirebug.com/releases/netexport/

Honza

Jan Honza Odvarko

unread,
Jan 13, 2015, 8:54:25 AM1/13/15
to fir...@googlegroups.com


On Tuesday, January 13, 2015 at 2:32:49 PM UTC+1, Arie Hoenel wrote:
deactivate autoExport then activate it again fix the problem and then export the file

Did you try Firebug 0.9b7?

Honza

Arie Hoenel

unread,
Jan 13, 2015, 9:09:54 AM1/13/15
to fir...@googlegroups.com
yes

--
You received this message because you are subscribed to a topic in the Google Groups "Firebug" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/firebug/POY5S7xuzqY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to firebug+u...@googlegroups.com.
To post to this group, send email to fir...@googlegroups.com.
Visit this group at http://groups.google.com/group/firebug.

Arie Hoenel

unread,
Jan 19, 2015, 2:52:48 AM1/19/15
to fir...@googlegroups.com
Hi Honza

I'm still getting the issue.
I tried manually to reproduce my test and see that when open FF with netexport enable I'm getting undefined error.
if I disable it and then activate it again then it's working... do you know if from javascript I can call the function to deactivate and activate it ?
or can you try to fix the issue ?

Thanks
Arie

Andreas Bäckman

unread,
Jan 22, 2015, 6:45:38 AM1/22/15
to fir...@googlegroups.com
Hi! i hade the same problem so i  added:
ProfilesIni profile1 = new ProfilesIni();   
   profile =  profile1.getProfile("default");
first and then set the preferences. 
now the export starts for me.

Arie Hoenel

unread,
Jan 28, 2015, 3:20:54 AM1/28/15
to fir...@googlegroups.com
Honza,

can you please take a look on the issue I write ? when loading FF page with netexport = true I can not export Har file by selenium, I have to manually turn it off and then on to get success to export net console to the file

I appreciate your help
Thanks
Arie

Jan Honza Odvarko

unread,
Jan 28, 2015, 12:20:16 PM1/28/15
to fir...@googlegroups.com
Yes I'll fix it, it's on my TODO list.
Make sure the issue is logged in this issue list:
https://github.com/firebug/netexport/issues


Honza

Arie Hoenel

unread,
Feb 5, 2015, 1:01:52 PM2/5/15
to fir...@googlegroups.com
Honza do you ETA for this issue ?

Jan Honza Odvarko

unread,
Feb 5, 2015, 1:21:08 PM2/5/15
to fir...@googlegroups.com
4 weeks

Honza

Jan Honza Odvarko

unread,
Feb 17, 2015, 11:20:59 AM2/17/15
to fir...@googlegroups.com
Firebug 3 alpha 9 has support for automated HAR export, see:
https://groups.google.com/forum/#!topic/firebug/oJwLFniRs-E

Feedback appreciated!

Honza

akshay monga

unread,
Aug 9, 2015, 10:18:38 AM8/9/15
to Firebug
I am still getting " window.NetExport.triggerExport " as NetExport as undefined in browser console.

Please is there any fix for this?

Akshay

Jan Honza Odvarko

unread,
Aug 10, 2015, 7:10:15 AM8/10/15
to Firebug
Support for (manual) HAR export has been included directly in Firefox 42

1. Start the browser, open Firefox developer tools (F12)
2. Select the Network panel, reload the page
3. Right click in the panel and pick "Copy All as HAR" or "Save All as HAR"

There is also an extension that allows to automate the export - HAR Export Trigger
https://github.com/firebug/har-export-trigger

Install the extension and use the following script on your page to auto-trigger HAR export:

var options = {
  token: "test",    // Value of the token in your preferences
  getData: true,    // Set to true if you want to also get HAR data
  title: "my custom title",  // Title used for the HAR file
  jsonp: false,     // Set to true if you want HARP
  fileName: "my test har file %Y, %H:%M:%S"  // Name of the file
};

HAR.triggerExport(options).then(result => {
  console.log(result.data);
});


Note that you need Firefox 42+ (to run this extension)

Honza
Reply all
Reply to author
Forward
0 new messages