This blog post talks about what is HAR file, is used for, How to generate a har file in chrome, firefox, and safari, and tools to view the har file.
What is the HAR file?
The har file is an acronym for the HTTP archive file, which is used to store the HTTP session information for all of a webpage’s HTTP requests. This file’s content is in json format. And file extension is HAR This file contains network call information for a single web page or multiple web pages.
What type of data does it contain?
- All the network calls are recorded with status
- All cookies and session information
- All the client information that the user-submitted
- And all logs about web browser page information
what can be used this data for?
- Performance inspection from the browser side like page slow, any third-party calls are taking time, and their status
- It helps to debug the issues from client-side
- Performance analysis
Following are steps that explain downloading HAR files for troubleshooting web requests offline.
How to generate the har file in Chrome?
- First, Open the chrome browser
- Next, open the developer tools either with shortcut Ctrl + Shift + I or menu -> more tools -> developer tools.
- Select the Network tab in the developer tools
- Open the webpage url that you want to track information.
- Check to preserve the log option to capture page interaction information on a single har file
- There are up and down arrow icons, an up icon for importing HAR files, Down icon for exporting HAR files.
- Click on the down arrow colored in read as you have seen below screenshot
generate har file in the Firefox browser
- Open the Firefox browser
- Open developer tools using either shortcut
Ctrl+Shift+Eor Tools menu -> Web Developer -> Networks
- Open a webpage to track information
- Open an icon right side as shown in the below screenshot
Save All As HARoption to generate the HAR file
- page navigation information also can be captured using persist Logs option
generate har file in Internet Explorer or Edge browser
- Open IE or Edge browser
- Open Developer tools with F12 shortcut or menu -> more tools -> developer tools
- Go to the Network tabs
- Open the webpage that wants to track data
- Click the save icon or Ctrl + S option to Export HAR
- You can check to save icon placement in the below screenshot
har file analyzer tools
Once you have the HAR file downloaded with the above steps, you can use google toolto analyze the content or data You can check below to analyze the imported file to
Discussed what is HAR file is used for and also how to generate this file in different browsers.
Hope you like this article.