Navigation in Playwright

From the Playwright cheat sheet ยท Navigation & Waiting ยท verified Jul 2026

Navigation

Navigate between pages and wait for load states

typescript
// Navigate to URL
await page.goto('/products');

// Wait for navigation after click
await page.getByRole('link', { name: 'Products' }).click();
await page.waitForURL('/products');

// Go back/forward
await page.goBack();
await page.goForward();
๐Ÿ’ก Playwright auto-waits for navigation to complete โ€” manual waits are rarely needed
โšก Use waitForResponse to synchronize on API calls triggered by user actions
๐Ÿ“Œ Avoid waitForTimeout (sleep) โ€” prefer waiting on specific conditions like URL or element state
๐ŸŸข waitUntil: "networkidle" waits for no network requests for 500ms โ€” useful for SPAs
navigationwaitgoto
Back to the full Playwright cheat sheet