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 error statements wouldn’t help them.
This is because they would need the technical details of the error-causing site to understand the issue and rectify it on your end. This is where the HAR file comes in handy. It is an HTTP Archived File format that records all interactions between your browser and the website currently opened.
Some of the data 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 rendering on-page elements. These 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 easy to create this network log file, and this guide will inform you 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 extensions to generate a HAR log file. The built-in developer tools can record error logs and generate HAR files.
Here are the steps to generate the HAR file:
- Launch the Chrome browser on your PC.
- Open the page whose logs you need to collect.
- Click on More
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 / + key; this should start the recording.
Make sure that you are seeing the red circular icon; if it’s a grey one, click on it once to turn red.
- Now try and reproduce the issue 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 at the extreme right to export this HAR File. - Give the 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.
Bottom Line
So this was all from this guide on creating a HAR File in Google Chrome. Remember that when the logs are being recorded, it will store all the resources being loaded during that current browser session.
This might include the cookies and any information you save during this time frame (such as passwords, payment details, etc.). So it’s better not to deal with confidential data while your session is 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 about the instructions above, please let us know in the comments section below.
Lastly, if you've any thoughts or feedback on How to Generate HAR file in Chrome browser, then feel free to drop in below comment box. You can also report the outdated information.