Skip to main content
Automation
DEFINITION

What is Auto-waiting?

Auto-waiting is how Playwright runs actionability checks on an element before acting on it. Before a click, it waits until the locator resolves to exactly one element that is visible, stable, receives events, is enabled and is not inert. If the checks do not pass within the timeout, the action fails with a TimeoutError.

No account needed · Scored in under a minute against a senior rubric

IN DEPTH

What does Auto-waiting mean in practice?

Each action has its own list of checks. locator.click(), locator.check() and locator.tap() wait for Visible, Stable, Receives Events, Enabled and Not Inert. locator.fill() and locator.clear() wait for Visible, Enabled, Editable and Not Inert. locator.hover() waits for Visible, Stable and Receives Events. Some actions, such as locator.focus(), locator.press() and locator.dispatchEvent(), run no checks at all.

The checks have precise meanings. Visible means a non-empty bounding box and no visibility:hidden style, so an element with opacity:0 counts as visible, while display:none and zero-size elements do not. Stable means the same bounding box for at least two animation frames in a row. Receives Events means the element is the hit target at the action point, not covered by an overlay. Editable means enabled and not readonly.

Assertions wait too. Auto-retrying assertions such as expect(locator).toBeVisible(), toHaveText() and toHaveCount() wait until the condition is met. Passing force to locator.click() disables non-essential checks, for example the check that the element actually receives the click.

WHY IT MATTERS

Why do interviewers ask about Auto-waiting?

Timing is a common cause of flaky UI tests. Auto-waiting removes the need for fixed sleeps, and interviewers expect you to say exactly what Playwright waits for, not that it "just waits".

EXAMPLE

What does Auto-waiting look like in a real project?

A sign-up form disables its Sign Up button while it checks with the server that the user name is unique. It then replaces the button with a new, enabled one. The test calls click() straight after typing the name. Playwright waits for an enabled button that receives events and clicks it, with no sleep in the test.

TIP

How should you talk about Auto-waiting in an interview?

List the checks for a click by name: exactly one element, visible, stable, receives events, enabled, not inert. Then say what happens when they fail (a TimeoutError) and why force is a last resort, not a fix for a flaky test.

FAQ

Common questions about Auto-waiting

Does Playwright auto-wait for assertions?

Yes, for its auto-retrying assertions. Locator assertions such as toBeVisible(), toHaveText() and toHaveCount() wait until the condition is met, the same way actions wait for their actionability checks.

What does the force option do in Playwright?

Passing force to an action such as locator.click() disables the non-essential actionability checks. For a click, Playwright then no longer checks that the element actually receives the click event. That can hide a real problem, such as an overlay a user could not click through.

Related Resources

Dive deeper with these related interview prep pages.

FREE TOOLS  /  no signup

Free QA career tools, no account needed

Instant and private, everything runs in your browser. Try them before you sign up.

EXEC.NOW

Ready to Ace Your QA Interview?

Practice explaining auto-waiting and other key concepts with our AI interviewer.

Join 600+ QA engineers already practicing with AssertHired.

Question 1 · Automation · Mid-levellive scoring

A test passes locally but fails in CI about one run in five. Walk me through what you check first, and why.

This single answer is scored on four dimensions: Technical accuracy · Coverage · Clarity · Best practices.

Rather skip ahead? Create a free account

FREE  ·  7-DAY TRIAL
Written by , Senior QA Automation Engineer, 50+ QA candidate interviews conductedLast updated October 2026