12 common Playwright errors with verified solutions.
The default action timeout (30 seconds) was exceeded before the operation could complete. This commonly occurs during navigation, element waits, or network-dependent operations.
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.
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.
A locator matched more than one element, but the action requires exactly one. Playwright's strict mode (enabled by default) prevents ambiguous interactions.
The target element exists in the DOM but is not visible. Playwright requires elements to be visible before interacting with them (clicking, typing, etc.).
Another element (like a modal, overlay, or tooltip) is covering the target element, preventing Playwright from clicking it.
The browser could not connect to the target URL. The server is not running, the port is blocked, or the URL is incorrect.
The browser page crashed during execution. This is typically caused by out-of-memory conditions or browser bugs.
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.
Playwright failed to capture a screenshot. This usually happens when the page or browser context is in an invalid state.
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.
A Playwright assertion (expect) timed out waiting for the expected condition. Playwright assertions auto-retry until the timeout, then fail.