Ravindra BagaleCourses & study guidesTrack your progress

Chapter 04 · Software Testing with AI Automation

First Automation with Playwright

Playwright is the primary tool on this path: one install, Chromium, and clear docs.

~4 min readBeginner

Why this matters

Selenium is still common in India, but Playwright is faster to start for new learners and works well with modern apps. We pick Playwright as primary; Selenium notes can come later.

What you will learn

You will install Node, init Playwright, run the sample test, then write a tiny test that opens a page and checks the title.

How to do it

Use the official Playwright getting-started guide. Prefer open demo sites or your own local app — never attack systems you do not own.

Steps (do these in order)

  1. Step 1 — Install. Node LTS, then npm init playwright@latest in a new folder. Accept the suggested defaults for a first project.
  2. Step 2 — Run sample. npx playwright test — confirm the sample passes. Open the HTML report once.
  3. Step 3 — First own test. Create tests/learnkart-home.spec.ts that goes to a demo URL you control or a public docs page and expects a title.
  4. Step 4 — See the browser. Run with headed mode once so you trust what the script does.
  5. Step 5 — Commit. Commit tests + config. Add node_modules to .gitignore. No secrets in the repo.

Practice

  • Paste the first test file into your notes and explain each line in plain English.
  • List two sites you must not automate against without permission.