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
  • 223,558
  • 70
  • 607
  • 592
user285oo6
  • 551
  • 7
  • 13
  • 28
  • This is much too broad to be answered. A HAR file contains quite a bit of information about how a web page is loaded. Read the spec here: https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/HAR/Overview.html — and I don't understand your question about "why only go for some particular browser". Are you asking why people would choose one browser over the other? – slhck Jan 17 '15 at 20:03
  • Ok then i will ask the other two seperately now in what way the .har file is used to analyze the issue which i was facing regarding the logout – user285oo6 Jan 17 '15 at 20:05
  • @slhck ya that's also my point when both the browsers are having the same test,developer tools then what set's them apart – user285oo6 Jan 17 '15 at 20:07
  • Well, I wouldn't recommend asking the questions separately if it's not clear what exactly you need to know. You should rather [edit] this one and make it a little more concise, i.e. by at least removing the other two questions and focusing on what specifically you want to know about HAR. It'd be good though if you read into the specification before, of course. It will answer lots of your questions, because everything that is saved is listed in the specification. – slhck Jan 17 '15 at 20:10
  • thanks for the specifcation although its purely technical could only understood some of it.now i have edited the post – user285oo6 Jan 17 '15 at 20:49

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
  • 223,558
  • 70
  • 607
  • 592
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,410
  • 1
  • 17
  • 21