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 a 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.
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 the HAR file in the Chrome browser:
- Launch the Chrome browser on your PC.
- Open the page whose logs you need to collect.
- Click on the situated at the top right, and select More Tools > Developer Tools.
You could also access the same via the + + chrome shortcut keys combination.
- Switch to the Network tab, and enable checkmark the Preserve Log option.
- Refresh the webpage using OR
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.
/ + key, this should start the recording.
- Now try and reproduce the issue that you were facing earlier so that it gets saved in this HAR error log.
- Click on the red circular icon to stop the recording.
- Click on the
icon situated at the extreme right to export this HAR File.
- Give file any name of your choice (but leave the extension as .har) and hit
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.
FAQs: Record and Generate HAR file in Chrome Browser
Now, let us go through the frequently asked questions regarding how to Record and Generate HAR file in Chrome Browser.
What is a HAR file?
HAR file is an HTTP archived file format which used to record all the interactions between your browser and the website currently opened.
What are the data recorded by a HAR file?
Some of the data that are stored in the HAR file include 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.
How to generate the HAR file in the Chrome browser?
Launch the Chrome browser on your PC and open the page whose logs you need to collect. Click on the three dots situated at the top right, select More Tools > Developer Tools and switch to the Network tab, and enable checkmark the Preserve Log option. Now, refresh the webpage which will start the recording. Next, try and reproduce the issue that you were facing earlier so that it gets saved in this HAR error log. Click on the red circular icon to stop the recording. and click on the Download icon situated at the extreme right to export this HAR File. Finally, give the file any name of your choice and hit Save.