How to Record and Generate HAR file in Chrome Browser?

HAR file or HTTP Archive file contains all the network and browsing sessions related logs used by developers for debugging an issue on the webpage. Generated HAR file records all the interactions including the cookies and passwords in the sessions.

If you come across a website that isn’t functioning along the expected lines and wishes to convey the same to the network administrator, then just sending the screenshot of that issue along with few lines of error statements wouldn’t be of much help to them.

This is because they would need to have the technical details of the error-causing site in order to understand the issue and hence rectify it on your end. This is where the HAR file comes in handy. It is an HTTP archived file format which used to record all the interactions between your browser and the website currently opened.

BrowserHow.com Generate HAR file

Some of the data that it stores includes the site loading time, the resources that are able to load correctly and the ones that are getting blocked, as well as the issues related to the rendering of on-page elements. All these types of network-related data are then stored and compressed into a HAR format.

Once this file is created, you could export and send it to the network administrator who would then be able to read the technical details and act accordingly.

In this regard, Google Chrome has made it pretty easy to create this network log file, and this guide will make you aware of the steps to do just that. So without further ado, let’s get started.

Generate HAR file in Chrome

You do not need to add any extensions for generating a HAR log file. You can use the built-in developer tools to record error logs and generate HAR files.

Here are the steps to generate HAR file in Chrome browser:

  1. Launch the Chrome browser on your PC.
  2. Open the page whose logs you need to collect.
  3. Click on the vertical 3dots icon situated at the top right, and select More Tools > Developer Tools.
    Developer Tools options in Chrome Menu listYou could also access the same via the Ctrl + Shift + I chrome shortcut keys combination.
  4. Switch to the Network tab, and enable checkmark the Preserve Log option.
    Network Tab Preserve Logs options in Chrome computer
  5. Refresh the webpage using reload arrow icon OR Ctrl/Cmd +R key, this should start the recording.
    Make sure that you are seeing the red circular icon, if it’s a grey one, then click on it once so that it turns red.
    Recording the Chrome Network tab for HAR file
  6. Now try and reproduce the issue that you were facing earlier so that it gets saved in this HAR error logs.
  7. Click on the red circular icon to stop the recording.
    Recording the Network Tab in Chrome browser
  8. Click on the Download icon situated at the extreme right to export this HAR File.
    Download button to save the network logs as HAR file
  9. Give file any name of your choice (but leave the extension as .har) and hit Save.
    Save HAR file with .har file extension

That’s it. The HAR file will all logs will be saved in a file. You may email it to the concerned authority or send it via any other medium of your choice.

Bottom Line: Create HAR file in Chrome

So this was all from this guide on how you could create a HAR File in Google Chrome. Do keep in mind that when the logs are being recorded, it will store all the resources that are being loaded during the course of that current browser session.

This might include the cookies and any information that you save during this time frame (such as passwords, payment details, etc.). So it’s better not to deal with the confidential data while your session is being recorded. Furthermore, only send the HAR file if you trust the developers at the other end.

On that note, we conclude this tutorial on how to generate HAR files in a chrome browser. If you have any queries related to the aforementioned instructions, do let us know in the comments section below.

Lastly, here are the recommended web browsers for your computer and mobile phone that you should give a try.

WindowsMacOSiOSAndroidLinux
Chrome WindowsChrome MacChrome iOSChrome AndroidFirefox Linux
Firefox WindowsSafari MacSafari iOSEdge AndroidChrome Linux
Edge WindowsFirefox MacEdge iOSSamsung InternetEdge Linux

If you've any thoughts on How to Record and Generate HAR file in Chrome Browser?, then feel free to drop in below comment box. If you find this article helpful, please consider sharing it with your network.

Also, please subscribe to our BrowserHow YouTube channel for helpful videos tutorials.

Disclosure: This page may contain affiliate links, which means we may receive compensation for your purchases using our links; of course at no extra cost to you (indeed, you may get special discounts). This will support our effort to create more useful content, and keep it open and free forever.
Share

Leave a Reply

Your email address will not be published. Required fields are marked *