How to Generate HAR File

How to Generate HAR File

Products
Frog_Artifactory
Content Type
User_Guide
AuthorFullName__c
Marwa Sharif, Kanishk Sharma
articleNumber
000005681
FirstPublishedDate
2023-04-16T08:34:52Z
lastModifiedDate
2025-06-15
VersionNumber
4
How to Generate HAR File

In this article, we are going to discuss the following points:
  • What is a HAR file
  • Why and when do we use a HAR file
  • How to generate a HAR file in Chrome and Firefox browsers
     
What is a HAR file?

A HAR (HTTP Archive) file is a log of all network requests and responses made by a web browser. The file format was designed to enable easy sharing and analysis of HTTP network traffic data.

A HAR file typically includes information about the following:
  1. HTTP requests and responses: Includes details such as URL, request method, response status, headers, and content.
  2. Timings: Includes the time it took for the request to be sent, the time it took for the response to be received, and other timings related to the request/response cycle.
  3. Cookies: Includes information about any cookies that were sent or received during the request/response cycle.
  4. Cache: Includes information about any caching that was used during the request/response cycle.
     

Why and when do we use a HAR file?

HAR files are generated using the browser developer tools or through specialized network monitoring tools. Once the HAR file is generated, it can be shared and analyzed by developers, testers, and system administrators. Overall, HAR files are a powerful tool for troubleshooting, performance analysis, security testing, and web application development.

Here are some specific reasons why and when HAR files are used:
  1. Debugging network issues: If a web page is not loading or is behaving unexpectedly, a HAR file can provide insight into the issue. A HAR file can help identify problems such as slow response times, network errors, or incorrect HTTP headers.
  2. Analyzing website performance: A HAR file can be used to measure and analyze the performance of a website. By analyzing the timings of individual requests, it's possible to identify bottlenecks and areas where performance can be improved.
  3. Investigating security vulnerabilities: A HAR file can help identify security vulnerabilities such as cross-site scripting (XSS) or cross-site request forgery (CSRF) attacks. By analyzing the requests and responses in the HAR file, it's possible to identify potential attack vectors and security weaknesses.
  4. Testing and development: HAR files can be used to test and develop web applications. They can be used to simulate network traffic and test how web pages respond to different network conditions.
How to generate a HAR file on Chrome and Firefox browsers
To generate a HAR file on Google Chrome or Firefox browser, follow these steps:
  1. Open the browser you want to use and navigate to the webpage you want to capture the network traffic for.
  2. Open the developer tools in your browser. This can typically be done by pressing Ctrl+Shift+I on Windows or Command+Option+I on a Mac or by right-clicking and choosing “Inspect” from the menu options.
  3. In the developer tools, go to the Network tab.
  4. Make sure the Preserve log checkbox is checked.
  5. Reload the webpage to capture all the network traffic.
  6. After the page has loaded, reproduce the issue, and once the task is completed. To download the HAR file, follow the instructions below.

    In Firefox, right-click on any of the requests in the Network tab and select "Save all as HAR with content".

    In Google Chrome, click on the “Export HAR” icon under the Network tab.
    Choose a location to save the HAR file and click Save.
     
Example on Google Chrome
User-added image 
 
Example on Firefox
 User-added image