Debugging Reference

Playwright Errors

Playwright logo

12 common Playwright errors with verified solutions.

TimeoutError: Exceeded 30000ms

The default action timeout (30 seconds) was exceeded before the operation could complete. This commonly occurs during navigation, element waits, or network-dependent operations.

high

TimeoutError: page.goto: Timeout 30000ms exceeded

Navigation 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.

high

TimeoutError: waiting for selector

Playwright 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.

high

Error: strict mode violation: locator resolved to N elements

A locator matched more than one element, but the action requires exactly one. Playwright's strict mode (enabled by default) prevents ambiguous interactions.

medium

Error: element is not visible

The target element exists in the DOM but is not visible. Playwright requires elements to be visible before interacting with them (clicking, typing, etc.).

medium

Error: element is intercepted by another element

Another element (like a modal, overlay, or tooltip) is covering the target element, preventing Playwright from clicking it.

medium

net::ERR_CONNECTION_REFUSED

The browser could not connect to the target URL. The server is not running, the port is blocked, or the URL is incorrect.

critical

Error: page.goto: Page crashed!

The browser page crashed during execution. This is typically caused by out-of-memory conditions or browser bugs.

critical

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.

high

Error: Failed to take screenshot

Playwright failed to capture a screenshot. This usually happens when the page or browser context is in an invalid state.

low

Error: frame was detached

The iframe or frame that was being interacted with was removed from the DOM during the operation. This commonly occurs with dynamic content that swaps iframes.

medium

Error: expect(locator).toBeVisible() — Timeout

A Playwright assertion (expect) timed out waiting for the expected condition. Playwright assertions auto-retry until the timeout, then fail.

medium