Skip to content

[Bug]: Browser.IsConnected remains true after node process and browser exit on Windows #3280

@yandrapragada

Description

@yandrapragada

Version

1.58.0

Steps to reproduce

I am encountering an issue where browser.IsConnected remains true even after the underlying Node.js process and the browser process have exited unexpectedly on Windows.

var playwright = await Playwright.CreateAsync();
var browserLauchOptions = new BrowserTypeLaunchOptions
{
    Headless = false,
    Channel = "chrome",
};
var browser = await playwright.Chromium.LaunchAsync(browserLauchOptions);
Console.WriteLine(browser.IsConnected ? "Browser is still connected" : "Browser is not connected");
await browser.CloseAsync();
await browser.DisposeAsync();
Console.WriteLine(browser.IsConnected ? "Browser is still connected" : "Browser is not connected");

  1. Start the sample program above.
  2. After the browser is launched, manually terminate the Node.js process associated with Playwright (e.g., via Task Manager).
  3. Observe the output of the two Console.WriteLine statements.

Expected behavior

If the Node.js process or the browser process is terminated, browser.IsConnected should reflect the actual connection state and return false.

Actual behavior

Both logs print "Browser is still connected", even though the Node.js and Chrome processes have ended (as confirmed in Task Manager).

Additional context

No response

Environment

OS: Windows
Playwright for .NET version: 1.58.0
Browser: Chrome (via Channel = "chrome")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions