HAR File From Every Automated Test Run, Without Opening the Developer Tools
A HAR file is a page's network log. Get one from every automated test run, for bug reports and CI builds, with cookies and tokens already hidden.
A HAR file (HTTP Archive) is a JSON file listing every request a web page made, with its timing, status and headers. GUI Test Studio gives you one from the automated test runs of a web app, its secrets hidden.
A support engineer or a developer reads your bug and answers with one question: can you send a HAR file? Then someone has to reproduce the bug with the developer tools open, at the right moment, and remember to clean the file before sending it.
What is a HAR file?
Definition
A HAR file is the network log of a web page, saved as JSON.
- Each entry is one request: the method, the address, the status the server answered, the headers sent and received, and how long it took.
The developer tools of Chrome, Edge and Firefox save it and open it.
The format itself is described in a draft specification.
network.har
Headers of the failed request
Accept:application/json
Authorization:(hidden)
Cookie:(hidden)
Body: never kept
Because it is a file, a HAR file travels: from the person who saw the bug to the person who can fix it. The developer opens it in the developer tools' Network tab and sees what the page asked the server and what the server answered, in order, with the times.
Why do support and developers ask for a HAR file?
A screenshot shows what went wrong on the screen. A HAR file shows what went wrong underneath it.
| What the screen shows | What the HAR file shows |
|---|---|
| The cart stays empty after Add to cart | POST /api/cart answered 500, a server error |
| A page loads slowly | One request waited several seconds for the server |
| A list shows nothing | The data request answered 401: the session had expired |
| An image is missing | Its address answered 404, not found |
| It works on one computer and not on another | The two network logs side by side show where they part |
That is why a bug report with a HAR file is fixed faster: the developer starts from the failed call, not from a guess.How to read the rest of a run is in how to read a test report.
How a HAR file is captured by hand, and what it costs
By hand, a HAR file is saved from the Network tab of the browser's developer tools, after the bug was reproduced with that tab open. It sounds small, and it is where most bug reports stall.
By hand
- 1Open the developer tools before the page loads
- 2Reproduce the bug at the right moment
- 3Save the file
- 4Remove cookies and tokens before sending it
A person, the bug and the right moment, every time.
From a test run
- The test run records every request
- Export it from the Confidence Report
- Secrets are already hidden
- One in every CI build too
Recorded at every run, nobody watching.
Each HAR file captured by hand costs the same chores.
- The tester has to reproduce the bug, which is the hard part of an intermittent one.
- The developer tools have to be open before the page loads, or the first requests are missing.
- The file holds everything the browser did during that time, so the failed call is somewhere in a long list.
- And the file must be cleaned before it is sent.
A bug that appears once in twenty runs, or only on the build server, may never be captured at all.Why such failures are worth catching rather than ignoring is in flaky tests and false positives.
HAR file privacy: what a HAR file can leak
The HAR format records the cookies and the headers of every request and answer, as its specification lists them.In a session where someone is signed in, that can mean session cookies, access tokens and authorization headers: the very values that sign that person in.
How GUI Test Studio keeps tests, recordings and reports on your own computers is the subject of data privacy in test automation.
A HAR file from every automated test run
GUI Test Studio is a testing solution where QA teams and AI agents build, run and manage tests visually, without code scripts. A recorded test replays by itself, the same steps in the same order at every run, and its engine verifies the application at every run.
Beside the screen, a run can record the page's network activity and logs, on the run's own clock.For a web app in Chrome, Edge or Firefox, with a browser window or without one, that is every request the page makes, its method, address, status, type, size and timing, the failures with the browser's reason, answers from the cache, web sockets, and the page's console.
Three ways to switch it on, none of them code.
When you record
The switch Record network activity and logs during test runs is on by default when you record a web app.
On an existing test
The Open Web App step of an older test has a Record During a Run option.
At a moment of the test
A Watch Network event on the time ruler starts or stops recording at any moment.
When the network is recorded, the page is opened empty first, then sent to its address, so even its very first request is in the file. Recording the network never fails a test: it is evidence.
In the run's Confidence Report, the Activity panel shows the requests as a waterfall on the run's timeline, with Errors only, Selected step only, a search and a type filter.When the step you select had a failed request, a line above the steps says so.Reading the network there is often enough; the HAR file is for whoever reads it elsewhere.The whole panel is described in Network activity and logs, and how to check that no request failed is in catch console errors in automated tests.
How to get a HAR file from a test run, step by step
Run
The web test
Open
The Activity panel
Export
Network activity (.har)
Send
To the developer
- 1
Let the test record the network
When you record a web app in GUI Test Runner-Recorder, leave Record network activity and logs during test runs on.For an existing test, turn on Record During a Run on its Open Web App step in GUI Test Studio.
- 2
Run the test
Click Run Test in GUI Test Runner-Recorder, or run it with gtr-cli.The run records every request the page makes, from its very first one.
- 3
Open the Activity panel
In the run's Confidence Report, open the Activity panel from its toolbar button and look at the Network tab.Errors only and Selected step only narrow the list.
- 4
Export the HAR file
Click Export, then Network activity (.har)..., and choose where to save the file.The log exports the same way, as a text file.
- 5
Send it, or send one request
Attach the HAR file to the ticket, or use Copy as cURL on the request that failed and paste it for the developer.
The run also saves its Confidence Report, so a HAR file can be exported from any earlier run of the test too.The Confidence Report guide shows where every run is kept.
A HAR file for every CI build
On a build agent, nobody is there to open the developer tools. gtr-cli runs the same tests, and with --artifacts it gathers each run's evidence into one folder your CI tool keeps with the build: the video, the Confidence Report, the failure pictures and, for a web test that records its network, network.har beside log.txt.
gtr-cli run tests --countdown 0 --junit results\junit.xml --artifacts results\artifactsThe Confidence Report
Activity panel, Export
A CI build
gtr-cli's artifacts folder
A bug report
Its evidence zip and its Jira issue
The console also prints one line per test with the requests and how many failed, and the JSON results carry the same activity.A failed build then comes with its own network log, and the developer opens the HAR file from the build page.Run tests in your pipeline lists every option, and run UI tests in TeamCity with gtr-cli shows a whole pipeline.
A HAR file in every bug report and Jira issue
The Bug Report button of the Confidence Report writes a PDF or an Excel report of the failed run, with a zip of evidence next to it.For a run that recorded its network, that zip holds network.har, log.txt and network_and_logs.json, and the report's notes say what went wrong around the failed step.
A checkout test fails on its check of the cart total. The bug report names the step, shows the expected and the actual screen, and its notes say that during that step POST /api/cart answered 500. The developer opens network.har from the evidence zip and starts from that call.
Sent to Jira, the issue carries the same evidence zip, and gtr-cli can file it by itself on a failed build.See bug reports and failed UI tests to Jira bugs with TeamCity.An AI assistant connected through our MCP server, such as Claude or ChatGPT with Codex, reads the same activity in a run's results; so does a local AI model, ours or your own.
Send developers one request: Copy as cURL
Sometimes a whole network log is more than anyone needs.On a request in the Activity panel, Copy as cURL puts that one request on the clipboard as a command a developer can run in a terminal, to send the same call to the server again.
- The developer sees the exact address, method and headers that failed.
- A header that was hidden is left out of the command, never copied.
- The request's body is never kept, so a call that needs one gets its data from the developer.
A failed call in the developer's terminal is worth ten screenshots of an empty cart.
When a step fails because the page went on before the server answered, the fix is a check that waits for that answer: see wait for an API response in UI tests.
A HAR file captured by hand vs one from a test run
| Question | Captured by hand | From a GUI Test Studio run |
|---|---|---|
| Who captures it | A person who reproduces the bug with the developer tools open | The test run, every time it runs |
| The first requests | Missing if the tools were opened after the page loaded | Recorded from the page's very first request |
| Secrets | Cookies and tokens to remove by hand before sending | Kept as "(hidden)" from the start |
| Bodies | Can hold what forms sent and what the server answered | Never kept |
| Finding the failure | A long list to search | Selected step only, and a line on the step that failed |
| On the build server | Nobody is there to capture one | network.har in every build's artifacts |
| The steps that led there | Written down by the tester, if they remember | The test's own steps, the same at every run |
In a coded framework such as Playwright or Selenium, a HAR file per test is code or configuration you write and keep: start the recording with each browser, name and store each file, and clean what it must not carry. In GUI Test Studio it is a switch, and the file is named and kept with the run.
The whole picture of what a run records beside the screen is in network and console logs in test runs.
What to know before you start
| Limit | What it means |
|---|---|
| A desktop program's requests | Not recorded: they are encrypted inside the program. Its connections are, with the server and port, but they are not in the HAR file. |
| A phone's network | Not recorded. The phone's own log is, and it goes to the log file. |
| Bodies | Never kept, in the report or in the HAR file. A developer who needs one reproduces the call. |
| During a run only | The network is recorded while a test runs, not while you record it or edit it. |
| Older tests | A test recorded before this option records nothing until you turn on Record During a Run or add a Watch Network event. |
Key takeaways
- 1A HAR file is the network log of a web page: every request with its address, status, headers and timing, in a JSON file the browsers' developer tools open.
- 2Capturing one by hand is a chore: reproduce the bug with the developer tools open, then clean the cookies and tokens before sending it.
- 3GUI Test Studio records the network during every run of a web test, from the page's very first request, with no code.
- 4The HAR file comes out where it is needed: the Confidence Report's Export, every CI build's artifacts, the bug report's evidence zip and its Jira issue.
- 5It is ready to share: secrets kept as "(hidden)", bodies never kept, and Copy as cURL for one request.
Questions
What is a HAR file?
A HAR file, short for HTTP Archive, is a JSON file that lists every network request a web page made. For each request it keeps the address, the method, the status, the headers and how long it took. Developers open it to see what the page asked the server and what the server answered.
How do I generate a HAR file without opening the developer tools?
Let an automated test run record it. In GUI Test Studio, a test of a web app records the page's network activity during every run, and the Confidence Report's Activity panel exports it as a HAR file. Nobody has to reproduce the bug by hand.
How do I open a HAR file?
Open it in the developer tools of Chrome, Edge or Firefox, whose Network tab imports a HAR file and shows its requests as a list. A HAR file is also plain JSON text, so any text editor opens it.
Is it safe to share a HAR file?
Only once it is cleaned. A HAR file captured by hand can hold the cookies, tokens and passwords of the session it was captured in, so they must be removed before it is sent. A HAR file exported from a GUI Test Studio run already keeps those values as "(hidden)" and never holds a request's or an answer's body.
Should I attach a HAR file to a bug report?
Yes, whenever the bug may come from a call to the server. In GUI Test Studio, the bug report's evidence zip holds the run's HAR file and its log, and the Jira issue made from the report carries the same zip.
Can I get a HAR file from every CI build?
Yes. When gtr-cli runs a web test with the --artifacts option, the artifacts folder holds network.har beside log.txt, the run's video and its report. Your CI tool keeps the folder with the build.
What is "Copy as cURL" for?
It turns one recorded request into a command a developer can run in a terminal to send the same call again. It is the shortest way to show a developer the exact request that failed, without the hidden secrets.
Does GUI Test Studio record the requests of desktop apps and phones?
Not their requests. For a desktop program it records which servers it connected to and which connections failed, plus its debug output and the log files you name, but those are not in the HAR file. A phone's network is not recorded; its own log is.
Playwright, Selenium, Chrome, Edge, Firefox, Jira, TeamCity, Claude, ChatGPT and Codex are trademarks of their respective owners.
Keep reading
All articles
Bug reports
Connect Jira to the Confidence Report: every failed end-to-end test becomes a Jira bug, automatically
8 min read

Test reliability
Network Logs and Console Logs in Test Runs: See Why a Test Failed
10 min read

Web testing
Console Errors in Automated Tests: Fail the Test at the Step That Caused Them
10 min read