🚨 Common Errors — Error Dictionary
Common Errors — Error Dictionary: Playwright error messages work like a well-written medical diagnosis report: even when the symptom is vague, the report spells out which organ w
Playwright error messages work like a well-written medical diagnosis report: even when the symptom is vague, the report spells out which organ was affected, when the problem occurred, and under what conditions. So why does the wording of an error message deserve a section of its own — how does it change anything about the bug underneath it? In Selenium, when you saw "NoSuchElementException" you had no Trace, no screenshot, just a stack trace — figuring out whether it was a bad locator, a timing issue, or an incomplete page load often took hours. In Playwright, a message like "Locator resolved to 2 elements" both names the problem and shows you the HTML of both elements that were matched; "Timeout 30000ms exceeded while waiting for element to be visible" tells you the timeout duration, the expected state, and exactly where the test was at that moment. Instead of the ambiguous NullPointerExceptions you dealt with in Java, you get action-oriented messages. The QA reality: the richer the error message for a test that fails at 3 AM in CI, the shorter the investigation time the next morning — Playwright's detailed errors and automatic screenshots cut that investigation window significantly.
🎬 The Same Failure, Two Different Reports
Test Fails at 3:14 AM in CI
Selenium: "NoSuchElementException"
Hours of Local Re-running
Playwright: Locator + State + Screenshot
Root Cause — Within Seconds
A test fails in the CI pipeline at 3:14 AM — nobody is watching live, there's just a red notification.
Contrast — the Selenium/Java report: "NoSuchElementException" — just a class name. Is the problem the locator, the timing, the wrong iframe? The report doesn't say.
The engineer sees this report in the morning: they must add System.out.println() lines, re-run locally over and over, and guess for hours.
The Playwright report: "TimeoutError: locator.click: Timeout 30000ms exceeded — waiting for locator('#submit-btn') to be visible" — it clearly states WHICH locator, WHAT state, and HOW LONG it waited.
An automatic screenshot and trace come attached to the message — the engineer reads it and sees the root cause within seconds, without running ANYTHING locally.
Final — investigation time drops from hours to minutes, because the diagnostic work was already done the moment the failure happened — the engineer's only job is to READ the report.
Step by Step: Reading a Playwright Error Message