DEV Community

Cover image for How to troubleshoot browser network call using har file ?
Avinash Dalvi for This is Learning

Posted on • Originally published at internetkatta.com

6 2

How to troubleshoot browser network call using har file ?

Hello Devs,

In this blog we will learn about how to get API network log and debug those for triaging issues if any. Few days back my client was facing some issues with the website. On this issue I wasn't able to debug on the client machine. For this I ask the client to export the .har file from the chrome browser network call tab. Then I used that file to triage issues and it helped me to triage requests and responses for particular use cases.

Let's see what is the .har file and what is it ?

What is the .har file format ?

har is a short form of HTTP ARchive format, which tracks all network logs from the browser console ( chrome, firefox, safari ). This can be used to troubleshooting follow issues :

  • Performance issue
  • Triage API request and response
  • Page rendering

Below are the HAR files generated depending on the browser variant you are using.

  • Chrome
  • Firefox
  • Internet Explorer
  • Microsoft Edge
  • Safari

How to get this har file ?

  1. Go to webpage right click and select inspect or press F12 Screenshot 2022-07-08 at 11.54.54 PM.png
  2. Go to network tab
  3. Click the export button or label. Screenshot 2022-07-08 at 11.56.42 PM.png

How to access or open this file ?

  1. har file can open in any text file
  2. can import to the same empty browser tab. By doing inspect element -> Network tab -> Import Screenshot 2022-07-09 at 12.03.49 AM.png

How does this help ?

This file helps us to debug or troubleshoot API request call request and response. After importing this API calls look exactly similar to the way it shows while loading the page. It includes everything: wait time, response time, initiator etc.

I hope this blog helps you to troubleshoot such issues if you come across them. Feel free to reach out to me on my twitter handle @aviboy2006 or comment in the blog. If you like my blog please don't forget to like the article. It will encourage me to write more helpful articles.

Image of Timescale

Timescale – the developer's data platform for modern apps, built on PostgreSQL

Timescale Cloud is PostgreSQL optimized for speed, scale, and performance. Over 3 million IoT, AI, crypto, and dev tool apps are powered by Timescale. Try it free today! No credit card required.

Try free

Top comments (1)

Collapse
 
coreder profile image
Coreder • Edited

look at harstud.io should help with more advanced features around the analysis.

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Immerse yourself in a wealth of knowledge with this piece, supported by the inclusive DEV Community—every developer, no matter where they are in their journey, is invited to contribute to our collective wisdom.

A simple “thank you” goes a long way—express your gratitude below in the comments!

Gathering insights enriches our journey on DEV and fortifies our community ties. Did you find this article valuable? Taking a moment to thank the author can have a significant impact.

Okay