What is auto-waiting in Playwright?
Written by Jatin Thacker, Automation Architect · Updated
This answer is one piece of Chapter 13: Waiting and Synchronisation.
- Auto-Waiting Deep Dive
- Explicit Waiting Methods
- Handling Race Conditions
- Controlling the Clock
- Practice and interview questions: Waiting & Synchronization
In earlier test automation tools, testers were forced to write explicit wait loops before every click or form input to ensure the button was clickable. Playwright eliminates this entire class of boilerplate through auto-waiting.
When you call await locator.click(), Playwright automatically checks actionability: it verifies the element is attached to the DOM, visible on screen, not animating or in motion, enabled, and not covered by an overlay or dialog backdrop. It retries these checks continuously until they pass or your action timeout elapses.
Auto-waiting applies to user interaction methods like click(), fill(), check(), and selectOption(). For assertions, web-first assertions provide the equivalent retry behavior. Together, they mean test code almost never requires manual wait statements.
import { test, expect } from '@playwright/test';
test('auto-waiting ensures actionability before clicking', async ({ page }) => {
await page.goto('/catalog.html?mock=static&seed=42&autologin=1');
const searchButton = page.getByTestId('catalog-search-submit');
await searchButton.click();
await expect(page.getByTestId('product-grid')).toBeVisible();
});1 passed (3.5s)
await button.click()?Practised in the full course: the drill Waiting is not asserting.
See the chapterRelated questions
AI can write the test now. The job is knowing whether it checks anything. That's what the course teaches, one chapter at a time.
163 lessons · 226 drills · start free