How to generate a HAR file?

Generating HAR files

HAR (HTTP Archive) is a file format used by several HTTP session tools to export the captured data. The format is basically a JSON object with a particular set of fields. Note that not all the fields in the HAR format are mandatory, and in many cases, some information won't be saved to the file.


HAR files contain sensitive data!

  • Content of the pages you downloaded while recording.
  • Your cookies would allow anyone with the HAR file to impersonate your account.
  • All the information that you submitted while recording: personal details, passwords, credit card numbers, etc.

If needed, you can edit a HAR file in a text editor and redact sensitive information.


You can get a capture of an HTTP session in many browsers, including Google Chrome, Microsoft Edge, and Mozilla Firefox.


Steps for generating HAR file for Google Chrome


Step 1:  Open the Developer Tools from the menu (Menu > More Tools > Developer tools), or by pressing F12 (or Fn-F12) on your keyboard.




Step 2: Click on the Network tab






Step 3: Look for a round button at the top left of the Network tab. Make sure it's red. If it's grey, click it once to start recording.







Step 4: Turn on "Preserve log"






Step 5: You can use the clear button (a circle with a diagonal line through it) right before trying to reproduce the issue to remove unnecessary header information.






Step 6: Reproduce the issue. ( For example, if you facing an issue in downloading a drive file reproduce the same issue while generating a HAR file )


Step 7: Save the capture by right-clicking on the grid and choosing "Save as HAR with Content".




Step 8: Click on Save