Chapter 32: Install Playwright and browsers
Automation learning lab
Playwright Automation
Self Study Guide
Start from zero. Learn JavaScript and TypeScript, automate browsers, and build reliable end-to-end tests.
Install Playwright and browsers
The Playwright initializer creates a starter project with dependencies, example tests and configuration. Browser binaries are separate from the npm package. Run setup inside a dedicated project directory with a supported Node.js version.
How it works
Step-by-step walkthrough
- Create a project folder
- Run the initializer and choose TypeScript
- Install browsers and run the example
Example
mkdir playwright-lab
cd playwright-lab
npm init playwright@latest
npx playwright install
npx playwright testOn Linux, npx playwright install --with-deps may be needed for system dependencies.
✎ Your practice task
Open the generated project in VS Code.
Knowledge check
Which command initializes a Playwright project?
🌐 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.