Recording a HAR file can aid in quickly identifying the cause of unexpected issues during debugging.
A HAR (HTTP Archive) file is a record of the network traffic between a web browser and a website. It contains valuable information about HTTP requests and responses, making it useful for debugging and performance analysis. This article provides step-by-step instructions for recording a HAR file in the most popular web browsers: Google Chrome, Mozilla Firefox, Microsoft Edge, and Safari.
Instructions for the different web browsers
-
Recording a HAR File in Google Chrome:
a. Open Google Chrome.
b. Press F12 on your keyboard to open the Developer Tools.
c. Click on the "Network" tab.
d. Ensure that the "Preserve log" option is enabled.
e. Optionally, you can disable the "Cache" option to ensure all requests are recorded.
f. Start recording by clicking the round record button or by pressing Ctrl + E.
g. Perform the desired actions on the website.
h. Once you're done, stop recording by clicking the same record button or by pressing Ctrl + E again.
i. Right-click anywhere on the list of network requests and choose "Save all as HAR with content" to save the HAR file to your computer.
-
Recording a HAR File in Mozilla Firefox:
a. Launch Mozilla Firefox.
b. Press F12 on your keyboard to open the Developer Tools.
c. Click on the "Network" tab.
d. Make sure the "Persist Logs" option is checked.
e. Optionally, you can disable the "Disable Cache" option to ensure all requests are recorded.
f. Start recording by clicking the "Start Recording" button (a round record button) or by pressing Ctrl + E.
g. Perform the desired actions on the website.
h. Once you're finished, stop recording by clicking the same "Start Recording" button or by pressing Ctrl + E again.
i. Right-click anywhere on the list of network requests and select "Save All As HAR" to save the HAR file to your computer.
-
Recording a HAR File in Microsoft Edge:
a. Open Microsoft Edge.
b. Press F12 on your keyboard to open the Developer Tools.
c. Click on the "Network" tab.
d. Make sure the "Persist Logs" option is enabled.
e. Optionally, you can disable the "Disable Cache" option to ensure all requests are recorded.
f. Start recording by clicking the round record button or by pressing Ctrl + E.
g. Perform the desired actions on the website.
h. Once you're done, stop recording by clicking the same record button or by pressing Ctrl + E again.
i. Right-click anywhere on the list of network requests and choose "Save as HAR with Content" to save the HAR file to your computer.
-
Recording a HAR File in Safari:
a. Launch Safari.
b. Click on "Safari" in the menu bar and select "Preferences."
c. Go to the "Advanced" tab.
d. Check the box next to "Show Develop menu in menu bar."
e. Close the Preferences window.
f. Click on "Develop" in the menu bar and select "Show Web Inspector."
g. In the Web Inspector window, click on the "Network" tab.
h. Ensure that the "Preserve log" option is enabled.
i. Optionally, you can disable the "Disable Caches" option to ensure all requests are recorded.
j. Perform the desired actions on the website.
Conclusion: Recording a HAR file can be a valuable troubleshooting and performance analysis tool when working with web browsers. This article provided step-by-step instructions for recording a HAR file in Google Chrome, Mozilla Firefox, Microsoft Edge and Safari. By following these instructions, you can generate a HAR file to share with developers or use for debugging purposes, helping to diagnose and resolve web-related issues effectively.