There HAR file is a sort-of standard archive format for recording Web Session on an Archive for later analysis (performance comparison, etc).
The easiest way to generate a HAR file of a manual browsing session using Chrome or Firefox2. In both cases there is a "Portable" Browser version, which can be very useful for the cases when workstation policies don't allow for installing plugins or extensions, and it's pretty straightforward to set up. Both options work fine, but it's marginally simpler (less hassle) to get it working in Chrome.
Google Chrome Portable can be found in http://portableapps.com/apps/internet/google_chrome_portable
- Open "Developer Tools"
- In the "Network" tab, check the "Preserve Log" option to avoid the traffic being discarded on page reload/refresh. ![Preserve Log in Chrome Dev Tools][chrome-devtools-net-keepfullsession-2015-02-12_17-54-52]
- Browse the site, to the relevant pages to get the traffic we want to work on.
- To export, right click and choose -> "Save as HAR with Content" ![Save as HAR with Content][chrome-devtools-net-export-all-session-2015-02-12_17-56-56]
[chrome-devtools-net-keepfullsession-2015-02-12_17-54-52]: https://gist.github.com/jjarava/5f26806bba75d052c41a/raw/6d87d6feda5a452a2db33bbc2c2bfb85a28cecaa/Chrome-DevTools-Net-KeepFullSession-2015-02-12_17-54-52.jpg "Preserve Log in Chrome Dev Tools" width="848px" height="335px" [chrome-devtools-net-export-all-session-2015-02-12_17-56-56]: https://gist.github.com/jjarava/5f26806bba75d052c41a/raw/91a257dee6b5b2bd85dcf728b64fb862c5767f2f/Chrome-DevTools-Net-Export-All-Session-2015-02-12_17-56-56.jpg "Save as HAR with Content" width="820px" height="338px"
Firefox Portable can be found in http://portableapps.com/apps/internet/firefox_portable
To be able to record navigation, it's necessary to install 2 extensions, Firebug and NetExport a FireBug extension1 that allows exporting the session:
- Install FireBug from http://getfirebug.com/
- Install the Firebug extension called NetExport http://www.softwareishard.com/blog/netexport/ - On this page you can get info on the different ways of exporting data, etc...
- The download page is at http://getfirebug.com/releases/netexport/
- The latest version as of
2015-02-18
is 0.9b7 http://getfirebug.com/releases/netexport/netExport-0.9b7.xpi
- Select the "Persist" button in the "Network" Tab in Firebug ![Persist Firebug Network Capture Across Page Reloads][firefox-firebug-persist-net-session-2015-02-12_18-05-46]
- Browse the site, to the relevant pages to get the traffic we want to work on.
- To export, in the drop-down menu labeled "Export" choose "Save As..." and select a name for the generated HAR file. ![Export FireBug Net Session][firefox-firebug-export-session-as-har-2015-02-12_18-05-46]
[firefox-firebug-persist-net-session-2015-02-12_18-05-46]: https://gist.github.com/jjarava/5f26806bba75d052c41a/raw/df5b3c3162ad24b6017731177f7fb62ebf4bdf41/Firefox-Firebug-Persist-Net-Session-2015-02-12_18-05-46.jpg "Persist Firebug Network Capture Across Page Reloads" width="853px" height="373px"
[firefox-firebug-export-session-as-har-2015-02-12_18-05-46]: https://gist.github.com/jjarava/5f26806bba75d052c41a/raw/4dec13f7005abbf35ce8e5beb9dbf8253b680124/Firefox-Firebug-Export-Session-as-HAR-2015-02-12_18-05-46.jpg "Export FireBug Net Session" width="840px" height="373px"
The HAR files allow for analysis at a later time of the session(s) that have been recorded.
As to how to "visualise" the HAR files, below are some options (I haven't tested all of them):
Developed by the author of the NetExport extension to FireBug, it's the one I've found mentioned more often (and the one I tend to use):
- Tool Link: http://www.softwareishard.com/har/viewer
- Blog/Doc about the tool: http://www.softwareishard.com/blog/har-viewer
- Offline HAR Viewer: http://code.google.com/p/harviewer/
- Chrome HAR Viewer
- Fiddler 2 - see instructions here: http://alertfox.com/using-fiddler2-instead-of-the-online-har-viewer/, more detail on Fiddler import/export options in this MSDN Blog Post
- PCAP Web Performance Analyzer
- Charles Proxy
- HTTPWatch
This is a field where there appears to be quite a lot of activity. This list is accurate to the best of my knowledge as of the time of writing (2015-02-18) but as always, Google is your friend!
1: Yes, we're getting close to getting recursive here, with extensions of the extensions... 😄
2: There is a list of tools that generate HAR files available online at http://www.softwareishard.com/blog/har-adopters/; quite a lot of the "usual suspects" like Fiddler from v2.2.9.6+, IE 9 Developer Tools... There are even ways to convert a PCAP file to HAR