Chapter 36: Navigation and pages
Automation learning lab
Playwright Automation
Self Study Guide
Start from zero. Learn JavaScript and TypeScript, automate browsers, and build reliable end-to-end tests.
Navigation and pages
page.goto navigates to an absolute URL or a relative URL when baseURL is configured. Use page.url or a web-first URL assertion to check navigation. A page represents a browser tab or popup. Avoid relying on arbitrary waits after navigation.
How it works
Step-by-step walkthrough
- Navigate to a public demo
- Check the URL
- Inspect the page title
Example
import { test, expect } from '@playwright/test';
test('open demo', async ({ page }) => {
await page.goto('https://example.com/');
await expect(page).toHaveTitle(/Example Domain/);
});External websites can change; prefer a controlled test environment.
✎ Your practice task
Try another permitted demo URL and update the expected title.
Knowledge check
Which method navigates to a URL?
🌐 Continue learning
60-chapter learning path
Start at chapter 1, or choose any topic. Your progress is tracked separately for each chapter.
JavaScript fundamentals
TypeScript fundamentals
Playwright • setup & locators
Playwright • interactions & assertions
Playwright • framework & debugging
Playwright • real-world automation
Interactive practice lab
Try the controls below and observe the corresponding Playwright locator instructions. This browser demo does not execute Node.js or Playwright Test; copy the code to your local Playwright project to automate it.
Task manager demo
Suggested automation
Actions on the demo update these examples. In your local test use a page that contains the same controls.
Download a standalone lab page, then serve it locally (for example with Python's http.server). Navigate to it in a Playwright test.