How to generate HAR for requests in Page?

1528 views
Skip to first unread message

Rajasankar

unread,
Dec 22, 2011, 2:17:39 AM12/22/11
to HTTP Archive Specification, errajasa...@gmail.com
Hi All,

I am trying to auto export of HAR for requests when Page is not
refreshed . Is that possible?

In real world example, I want to see the requests in more in Twitter
or More stories in FB. These things will be shown in Firebug net panel
but will not be exported automatically. Can little of bit of tweak
will achieve this?

Thanks for the great tool.

Rajasankar

Jan Honza Odvarko

unread,
Dec 22, 2011, 8:08:35 AM12/22/11
to http-archive-...@googlegroups.com, errajasa...@gmail.com
On Thursday, December 22, 2011 8:17:39 AM UTC+1, Rajasankar wrote:
Hi All,

I am trying to auto export of HAR for requests when Page is not
refreshed . Is that possible?
I don't understand this question.
 
In real world example, I want to see the requests in more in Twitter
or More stories in FB. These things will be shown in Firebug net panel
but will not be exported automatically. Can little of bit of tweak
will achieve this?

You can install NetExport (Firebug extension) and set extensions.firebug.netexport.alwaysEnableAutoExport preference to true.

Then load a page and see a log within your Firefox profile directory

See further prefs for the NetExport extension
http://code.google.com/p/fbug/source/browse/netexport/branches/netexport0.8/defaults/preferences/prefs.js

Honza



Raja sankar

unread,
Dec 23, 2011, 12:59:31 AM12/23/11
to http-archive-...@googlegroups.com
Hi Jan,

Thanks for the reply.

I'm working in NetExport+Selenium WebDriver combination. When a new is loaded or existing page is refreshed, I can get the HAR files in the destination folder. Works great.

Now comes the trickiest part. If there is no page load, only a div/iframe load then it is not working. If my understanding is correct, Browser has to load a page within a timelimit for HAR export the file. Is there any way, I can export it by calling any commands? Is that possible.

Your help is appreciated.

Rajasankar

ராஜசங்கர்

Jan Honza Odvarko

unread,
Dec 23, 2011, 3:51:05 AM12/23/11
to http-archive-...@googlegroups.com
On Friday, December 23, 2011 6:59:31 AM UTC+1, Rajasankar wrote:
Now comes the trickiest part. If there is no page load, only a div/iframe load then it is not working. If my understanding is correct, Browser has to load a page within a timelimit for HAR export the file. Is there any way, I can export it by calling any commands? Is that possible.
I see

Is Selenium WebDriver able to call also chrome functions? (i.e. API coming from Firefox extensions)

Here is the function that executes if you pick "Save As" in the Net panel.
http://code.google.com/p/fbug/source/browse/netexport/branches/netexport0.8/chrome/content/netexport/netExport.js#99

You could also skip the user dialog for picking file name by calling directly this function that returns HAR string.
http://code.google.com/p/fbug/source/browse/netexport/branches/netexport0.8/chrome/content/netexport/exporter.js#290

Honza

Raja sankar

unread,
Dec 23, 2011, 10:04:46 PM12/23/11
to http-archive-...@googlegroups.com
Thanks for the points. It will be helpful.

I think, WebDriver can do this. I will work on and post the progress. It will help others too.

Rajasankar
ராஜசங்கர்

cerebrotecnologico

unread,
Nov 5, 2012, 2:20:24 PM11/5/12
to http-archive-...@googlegroups.com
Pardon my question. I have never executed scripts through the WebDriver.

How do I execute those functions? I am using the FirefoxDriver. 
I am assuming that I need to call firefoxDriver.executeScript() , but I don't know what parameters I need to send.

-Jorge

cerebrotecnologico

unread,
Nov 5, 2012, 2:43:48 PM11/5/12
to http-archive-...@googlegroups.com
In particular, I am interested on calling the function that returns the HAR string (without generating the HAR file).
I'm using the FirefoxDriver from Java. (Using Firefox 16, netexport 0.9b1, firebug 1.11.0a5)

abu abu

unread,
Aug 28, 2013, 9:30:52 AM8/28/13
to http-archive-...@googlegroups.com, errajasa...@gmail.com

I too hav tat same doubt. is ter anyone who knows how to achieve it using java. I am using selenium+firebug+netpanel

calin marina

unread,
Jul 2, 2014, 12:28:50 PM7/2/14
to http-archive-...@googlegroups.com
Hi Rajasankar,
it's been a while since you've written this and now I came to need and read about it ... have you managed to to this? please shed some light if you did

thanks
Reply all
Reply to author
Forward
0 new messages