Could Playwright for .NET leave a connection to the website open?

Rod Falanga 1,076 Reputation points
2026-08-22T02:34:29.5233333+00:00

Tonight I was in a Starbucks. I wanted to test an application I wrote using Playwright for .NET which test a website I wrote. It has worked fine in the past, when I developed the app on my Windows 11 desktop. But when I cloned the repo to my laptop at the Starbucks, then tried to run it, I got errors because I hadn't installed the browser components to test it with Playwright for .NET. I tried to resolve that but had to give it up because the Internet speed at the Starbucks is abysmal. I had to give up, but later I tried to just bring it up in the browser on my laptop, but it timed out on every Playwright for .NET test. Even just trying to open the website in the browser met with delays. However, I am now on my desktop, and I got to the website fine.

So, now I'm wondering, could Playwright for .NET leave a connection to a website open, if something should fail or like what I had to do was stop the installation of the browser components in the Playwright for .NET project?

Developer technologies | .NET | Other
0 comments No comments

Answer accepted by question author
AgaveJoe 31,546 Reputation points
2026-08-22T11:47:47.2866667+00:00

When you run dotnet test, the test runner only executes the test assembly. Rod, did you remember to start the web host on your laptop before executing the test runner? What you describe is exactly what happens when you try to access localhost:port when the application server is not running.

I am also making the assumption that your development lifecycle requires successful testing locally on the dev machine before deploying to a remote server. We need to know what BaseUrl is configured in the test project:

Is the test project sending HTTP requests to localhost? If so, your Wi-Fi connection speed is irrelevant. If the local web server isn't actively running and listening on that exact port, every test (and manual browser attempt) will simply hang and time out. Take a look at the browser's address bar when the test runs.

If your intention is to run tests against a remote web server, is the BaseUrl configured for that remote endpoint? If so, why clone the application source code to the laptop? Just to run tests? Furthermore, public Wi-Fi networks frequently block non-standard ports, throttle traffic, or suffer high packet loss that easily triggers Playwright's default 30-second navigation timeouts.

Clarifying whether your target is localhost or remote—and verifying that the host process was actually active—will pinpoint why the laptop failed.

Was this answer helpful?

1 person found this answer helpful.

Answer accepted by question author
Gidado Mukhtar Balangoggo 5 Reputation points
2026-08-22T05:37:39.36+00:00

Hi Rod,

I have definitely been there! Trying to download dependencies or run automation tests on public coffee shop Wi-Fi can be an incredibly frustrating experience.

To answer your question directly: No, it is highly unlikely that Playwright for .NET left a network connection open to your website that caused those timeouts.

Here is a breakdown of what likely happened behind the scenes:

The Installation Phase: When you run the Playwright browser installation (e.g., pwsh bin/Debug/netX/playwright.ps1 install), Playwright is only communicating with Microsoft's CDNs to download the Chromium, Firefox, and WebKit binaries. If you force-stopped this process due to slow internet, it never even attempted to reach out to your personal website.

Zombie Processes (Local Impact): If a Playwright test starts but is abruptly killed or crashes before it can properly execute browser.CloseAsync(), it can leave headless browser processes (like Chromium or MS Edge) running in the background of your laptop. These "zombie" processes consume local RAM and CPU. While they do not hold an active HTTP connection that locks up your web server, they can heavily bog down your laptop's local network stack and memory, making manual browsing feel terribly slow.

The Network Variable: The most likely culprit for the timeouts was the Starbucks Wi-Fi itself. Public networks often suffer from heavy packet loss, aggressive throttling, and unstable DNS routing. The fact that the website loaded perfectly when you returned to your desktop's stable network confirms that your web server was healthy and not locked up by a hung connection.

For future troubleshooting, if a Playwright test crashes and your machine feels sluggish, open your Task Manager and look for lingering, background instances of Chromium or Edge that Playwright may have orphaned, and manually end those tasks.

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.