0

I was facing an issue regarding a particular site for which I contacted the team. They told me to re-create the situation in the Google Chrome and once the issue starts to go to Developer tools, choose Network, right click anywhere and then save the HAR file generated as explained here.

Now I want to pin-point the error/reason behind it. How do I analyze the report when I can't open it?

I tried to open the file using the Windows file association system but it didn't recognize the file type. Does it require any special software to analyze the report?

slhck
  • 235,242

2 Answers2

0

A HTTP Archive (HAR) is nothing else but a plain text file. The data in it is stored as JSON, so you can open the file with any text editor or JSON editor. You could simply try renaming the .har extension to .json.

The HAR file will primarily list all of the network requests and responses the browser makes and receives. This includes basically everything you see in the Network tab from Google Chrome, like the specific URL of a request, but also all of the HTTP GET and POST parameters. Of course, the HAR file also contains timings, so you can see how long it took to load some resource.

"request": {
    "method": "GET",
    "url": "http://www.example.com/path/?param=value",
    "httpVersion": "HTTP/1.1",
    "cookies": [],
    "headers": [],
    "queryString" : [],
    "postData" : {},
    "headersSize" : 150,
    "bodySize" : 0,
    "comment" : ""
}

Here you can see that example.com/path was requested and the param GET parameter was sent, with its value set to value.

Of course, this data alone will not enable you to track down an error, especially not if you're just the user of a website, without access to the actual backend. The developers however can "replay" a HAR file, meaning that they can try doing what you did and see whether they can reproduce the errors, especially since they also have the cookies. This makes it possible to pretend that they're you when using the website.

Mind you that since all the data sent to the server is saved in the HAR file, any login data or private information you sent through a form will also be saved. That means, for example, when you log into a website, and create a HAR from these requests, your password is saved in plain text.

So make sure to check the contents of the file and don't submit anything you wouldn't want the developers to see.

slhck
  • 235,242
0

Chrome cannot replay a session from a HAR file. Although there are a bunch of tools that support HAR & allow exporting, only a some of them like Fiddler allow import & replay

mvark
  • 2,430