# Playwright timeout exceeded

Classification: timing-race
Frameworks: Playwright
Canonical: https://automationtester.in/failures/playwright-timeout-exceeded

## Recognizable error

```text
TimeoutError: locator.click: Timeout 30000ms exceeded.
```

## What it means

Playwright stopped waiting because an action or assertion did not reach its expected state before the configured timeout.

## Ranked causes, checks, and fixes

### 1. The element never reached the required state

The locator resolved, but the target stayed hidden, disabled, moving, or covered.

Diagnostic: Open the trace and inspect the actionability log immediately before the timeout.

Fix: Wait for the user-visible state that enables the action, then act on a role or test-id locator.

### 2. The locator no longer identifies the intended element

A text, role, label, or DOM structure changed and the locator now resolves to zero or multiple nodes.

Diagnostic: Run the locator in the trace viewer or Playwright inspector and check its match count.

Fix: Replace structural selectors with a unique role, label, or test-id contract.

### 3. The application request did not complete

A failed or stalled API request prevented the page from reaching the expected state.

Diagnostic: Inspect failed requests and console errors in the trace instead of increasing the timeout first.

Fix: Fix or mock the failing dependency and wait on the resulting UI state rather than a fixed delay.

## Prevention

- Capture a trace on the first retry.
- Assert the state that enables the next action.
- Keep locator contracts stable and unique.

## Primary references

- [Playwright timeouts](https://playwright.dev/docs/test-timeouts)
- [Playwright actionability](https://playwright.dev/docs/actionability)

Triage this failure locally: https://automationtester.in/tools/test-failure-triage