# Error: browser has been closed (Playwright)

Source: https://www.observeone.com/community/errors/playwright/browser-closed

[ObserveOne](/)[Features](/#features)[Pricing](/#pricing)[Blog](/blog)[CLI](/cli)[Docs](/docs)

[Sign in](https://app.observeone.com/auth?tab=signin)[Start Free](https://app.observeone.com/auth?tab=signup)

[Error Dictionary](/community/errors)/[Playwright](/community/errors/playwright)/browser-closedhigh

# Error: browser has been closed

An operation was attempted on a browser or page that has already been closed. This often happens in afterEach hooks or when tests share browser instances incorrectly.

## Common Causes

- 1Test cleanup closed the browser before other tests finished
- 2browser.close() called in afterAll while tests are still running
- 3Unhandled exception in one test caused browser to close, affecting subsequent tests
- 4Using a shared browser instance across test files

## How to Fix

### Use Playwright's built-in fixtures

// Use the built-in 'page' fixture — Playwright manages lifecycle
test('my test', async ({ page }) => {
 await page.goto('/');
 // page is automatically created and destroyed per test
});Playwright's test fixtures handle browser lifecycle automatically. Avoid manual browser management.

## How ObserveOne Helps

ObserveOne manages test environments and ensures clean browser lifecycle management across your test suite.

[Start Monitoring Free](https://app.observeone.com/auth?tab=signup)

## Related Errors

[net::ERR_CONNECTION_REFUSEDThe browser could not connect to the target URL. The server is not running, the port is blocked, or the URL is incorrect.](/community/errors/playwright/net-err-connection-refused)[Error: page.goto: Page crashed!The browser page crashed during execution. This is typically caused by out-of-memory conditions or browser bugs.](/community/errors/playwright/page-crash)[TimeoutError: Exceeded 30000msThe default action timeout (30 seconds) was exceeded before the operation could complete. This commonly occurs during navigation, element waits, or network-dependent operations.](/community/errors/playwright/timeout-30000ms)[TimeoutError: page.goto: Timeout 30000ms exceededNavigation to the target URL did not complete within the timeout period. The page either failed to respond or took too long to reach the 'load' event.](/community/errors/playwright/navigation-timeout)[TimeoutError: waiting for selectorPlaywright waited for an element matching the given selector but it did not appear within the timeout. The element may not exist, may be hidden, or may appear under a different selector.](/community/errors/playwright/waiting-for-selector)

ObserveOne

Agentic QA and synthetic monitoring built for engineering teams. Plan, generate, and run suites from the web UI. Connect to CI for reliable coverage across critical journeys.

### Product

- [Features](/#features)
- [Pricing](/#pricing)
- [QA Coverage](/qa-coverage)
- [API Monitoring](/api-monitoring)
- [Free Website Check](/free-website-check)

### Developers

- [CLI](/cli)
- [Docs](/docs)
- [For Agents](/agents)
- [Self-host (oo-workers)](/workers)
- [Status Pages](/status)
- [Netlify Extension](https://app.netlify.com/extensions/mzs1lgc3-observeone)

### Resources

- [Blog](/blog)
- [Bug Book](/bug-book)
- [Guides](/community/guides)
- [Tools](/community/tools)
- [Error Dictionary](/community/errors)

### Compare

- [Tool Comparisons](/compare)
- [Tool Alternatives](/alternatives)
- [Best by Category](/best)
- [Search](/search)

© 2026 ObserveOne. All rights reserved.

[About](/about)[Privacy Policy](/privacy)[Terms of Service](/terms)[Affiliates](/affiliates)[Become an Affiliate](/affiliate-terms)
