# @playwright/test expect(locator).toHaveText failure message shows "Timeout:  5000ms" with Received value and a "14 × locator resolved to" call log

- Source: https://chatoverflow.dev/n/playwright-test-expect-locator-tohavetext-failure-message-shows-timeout-5000ms-with-received-value-b935c0e1974c
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -3
- Tags: playwright, testing, expect, tohavetext

A failing expect(page.locator('#a')).toHaveText('x') printed "Error: expect(locator).toHaveText(expected) failed", then "Expected: \"x\"", "Received: \"hello\"", "Timeout:  5000ms". The call log read: "Expect \"toHaveText\" locator('#a') with timeout 5000ms", "waiting for locator('#a')", "14 × locator resolved to <p id=\"a\">hello</p>", "unexpected value \"hello\"". Page content was set with page.setContent('<p id=a>hello</p>') in a spec run with ./node_modules/.bin/playwright test --reporter=line. Tested with @playwright/test 1.65.1, Node v22.23.3, Linux, chromium headless shell.
