A step-by-step path from zero coding to professional-level web test automation, using Playwright with TypeScript as the main tool and Selenium as a later module. It expands Route 1 of the QA Career Rebuild. Plan on about 20 hours a week; Stages 0–4 line up with weeks 1–4 of the 90-day route.
0 of 65 done
How to use this guide
- Work through the stages in order. Each stage ends with a checkpoint; don't move on until you can do it without help.
- Type the code yourself instead of copying it. That is how it sticks.
- Keep everything in one practice project on GitHub from Stage 3 onward. It becomes Portfolio Project 1.
- Free practice sites: https://demo.playwright.dev/todomvc, https://www.saucedemo.com and https://the-internet.herokuapp.com. Never test real company sites or use real customer data.
Stage overview
| Stage | Topic | Rough time |
|---|---|---|
| 0 | Set up your computer | 1–2 days |
| 1 | Programming fundamentals in TypeScript | 1–2 weeks |
| 2 | How web pages work (HTML, the DOM, selectors) | 3–4 days |
| 3 | Your first Playwright tests | 1 week |
| 4 | Locators, assertions and test design | 1 week |
| 5 | Organising a real test suite (Page Object Model, fixtures) | 1–2 weeks |
| 6 | Debugging, flaky tests and reports | 1 week |
| 7 | Running tests automatically (Git and GitHub Actions) | 3–4 days |
| 8 | Advanced Playwright (API calls, auth, mocking, visual checks) | 2 weeks |
| 9 | Selenium module | 1 week |
| 10 | Professional level: portfolio and interview readiness | ongoing |
Stage 0 — Set up your computer 0 of 1
a working setup where you can write and run code.
Stage notes
- Install Node.js (the LTS version) from https://nodejs.org. Node.js is the program that runs JavaScript and TypeScript code outside a browser.
- Install Visual Studio Code (VS Code), a free code editor.
- In VS Code, install the extension Playwright Test for VSCode (by Microsoft).
- Install Git from https://git-scm.com and create a free GitHub account. Git saves versions of your work; GitHub stores it online.
- Open a terminal (the text window where you type commands) and run
node -vandgit --version. If both print a version number, you're set.
Stage 1 — Programming fundamentals in TypeScript 0 of 5
read and write simple code with confidence. TypeScript is JavaScript with "types" added, which means the editor warns you when you use a value the wrong way.
Stage notes
Learn these, in this order:
- Variables — named boxes that hold values (
const name = "Syad";let count = 0). - Types — text (
string), numbers (number), true/false (boolean), lists (arrays) and objects (groups of named values). - Conditions —
if/else: do something only when a check is true. - Loops —
forandfor...of: repeat something for each item in a list. - Functions — reusable blocks of code that take inputs and return a result.
- Async and await — browsers take time to load, so most Playwright commands "wait" for a result.
awaitmeans "wait for this step to finish before the next one." This is the single most important concept for Playwright. - Error handling —
try/catch: deal with something going wrong without crashing. - Modules — splitting code across files with
importandexport.
Where to learn: the free TypeScript Handbook (https://www.typescriptlang.org/docs/handbook/intro.html) or any low-cost introductory TypeScript or JavaScript course. Stay within the guide's $0–$250 budget.
Practice exercises:
Stage 2 — How web pages work 0 of 3
understand what you're actually testing.
Stage notes
- HTML — the building blocks of a page: buttons, inputs, links, headings, forms.
- The DOM — the live structure of a page that the browser builds from the HTML. Tests find and act on items in the DOM.
- Developer Tools — press F12 in Chrome. Use the Elements tab to inspect any button and see its HTML.
- Attributes — extra details on an element, like
id,class,name,placeholderanddata-testid. - Accessibility roles — every element has a role (button, link, textbox, heading). Playwright's best locators use these.
- CSS selectors and XPath — older ways to point at elements. Know what they are; you'll prefer Playwright locators.
Practice exercises:
Stage 3 — Your first Playwright tests 0 of 6
install Playwright and run real tests.
Stage notes
- Make a new folder, open it in VS Code, and in the terminal run
npm init playwright@latest. Choose TypeScript, keep the defaulttestsfolder, and say yes to installing browsers. - Run the example test with
npx playwright test. Then open the report withnpx playwright show-report. - Learn the shape of a test:
test('name', async ({ page }) => { ... }). Thepageis a browser tab Playwright controls. - Learn the core actions:
page.goto()(open a page),click(),fill()(type into a box),check(),selectOption(). - Learn your first assertion:
await expect(...).toBeVisible()andtoHaveText(). An assertion is the check that decides pass or fail. - Try codegen:
npx playwright codegen https://www.saucedemo.com. It records your clicks as code. Use it to learn, then clean up what it writes. - Run tests in UI mode with
npx playwright test --uito watch each step. - Put the project on GitHub (
git init,git add,git commit,git push).
Practice exercises:
Stage 4 — Locators, assertions and test design 0 of 6
tests that are stable and actually check the right things.
Stage notes
- Preferred locators, best first:
getByRole()(by role and visible name),getByLabel(),getByPlaceholder(),getByText(),getByTestId(). Use CSS or XPath only as a last resort. A locator is how a test points at an element. - Auto-waiting — Playwright waits for elements to be ready before acting. Never add fixed waits like
waitForTimeout(3000); they make tests slow and flaky. - Web-first assertions —
toBeVisible(),toHaveText(),toHaveValue(),toHaveURL(),toHaveCount(),toBeEnabled(). These retry until they pass or time out. - Test design basics — for each feature, write positive tests (it works), negative tests (bad input is rejected) and boundary tests (values at the edges, like an empty box or the maximum length).
- Independent tests — each test sets up what it needs and doesn't depend on another test running first.
- Hooks —
test.beforeEach()runs setup (like logging in) before every test in a file.test.describe()groups related tests. - Clear names — a test name should say what it proves: "locked-out user sees an error message."
Practice exercises:
Next step: once you pass this checkpoint, start the Postman and API Testing Training Guide at Stage 0.
Stage 5 — Organising a real test suite 0 of 7
a suite that is easy to read, change and grow. This is what separates a beginner from someone employable.
Stage notes
- Page Object Model (POM) — a pattern where each page of the app gets its own file (a "class") holding its locators and actions. Tests then read like plain steps:
loginPage.login(user, password). When the app changes, you fix one file, not fifty tests. - Fixtures — Playwright's way to hand ready-made things to a test, like a logged-in page or a page object. Learn to write a custom fixture with
test.extend(). - Test data — keep usernames, products and expected messages in a separate data file instead of typing them into every test.
- Configuration — learn
playwright.config.ts: the base URL, which browsers to run (Chromium, Firefox, WebKit), timeouts, retries and screenshots on failure. - Environment variables — keep passwords and URLs out of your code using a
.envfile that is never uploaded to GitHub. Add it to.gitignore. - Folder structure — a common layout:
tests/,pages/,fixtures/,data/. - README — explain what the project tests, how to install it and how to run it.
Practice exercises:
Stage 6 — Debugging, flaky tests and reports 0 of 5
find out why a test failed, fast. The guide lists "evidence of debugging" as part of an employer-ready portfolio.
Stage notes
- Read the error — Playwright tells you which line failed, what it expected and what it got. Start there.
- Debug mode —
npx playwright test --debugpauses on each step so you can watch and step through. - Trace Viewer — turn on traces in the config. A trace records every step, screenshot, network call and console message. Open it with
npx playwright show-trace. Professionals rely on this daily. - Screenshots and video — set them to save only on failure.
- Flaky tests — tests that pass sometimes and fail other times. Common causes: fixed waits, tests that depend on each other, shared test data, weak locators and timing issues. Fix the cause; don't just add retries.
- Reports — the built-in HTML report shows passes, failures and traces. Learn to read it and to share it.
- Bug reports — when a test finds a real bug, write it up: steps to reproduce, expected result, actual result, screenshot or trace.
Practice exercises:
Stage 7 — Running tests automatically (Git and GitHub Actions) 0 of 5
tests run by themselves every time code changes. This is "CI" (continuous integration), and it shows up in most QA job descriptions.
Stage notes
- Git habits — small commits with clear messages, working on a branch (a separate line of work), then merging. Learn
git status,git log,git branch,git checkoutandgit pull. - Pull requests — on GitHub, propose a change from a branch and review it before merging. Teams work this way.
- GitHub Actions — GitHub's free system for running tasks automatically. The settings live in a YAML file, a plain-text settings file where indentation matters. When you installed Playwright it offered to create one at
.github/workflows/playwright.yml. - Make the workflow run your tests on every push and pull request, and save the HTML report as a downloadable "artifact."
- Secrets — store passwords in GitHub's repository Secrets, never in the code or the YAML file.
- Add a status badge to your README showing whether the tests currently pass.
- Learn the free GitHub Skills courses at https://skills.github.com for Git fundamentals and Actions.
Practice exercises:
Stage 8 — Advanced Playwright 0 of 7
the skills that move you from junior toward mid-level.
Stage notes
- Saved login (authentication state) — log in once in a setup step, save the session with
storageState, and reuse it so tests don't log in every time. This makes suites much faster. - API testing inside Playwright — the
requestfixture sends calls straight to an API (no browser). Use it to check responses, status codes and data. It ties in with Route 2. - API setup for UI tests — create test data through the API before a UI test, then check it in the browser. Faster and more reliable than clicking through setup.
- Network mocking —
page.route()lets you fake a server's response, for example to test how the page shows an error when the server fails. - Parallel runs and sharding — run tests at the same time across workers, and split big suites across machines in CI.
- Visual comparison —
toHaveScreenshot()compares a page against a saved image to catch layout changes. - Mobile and cross-browser — use Playwright's device settings to test phone screen sizes.
- Tags and filtering — tag tests like
@smokeor@regressionand run only those with--grep. - Accessibility checks — add the
@axe-core/playwrightpackage to scan pages for common accessibility problems.
Practice exercises:
Stage 9 — Selenium module 0 of 5
enough Selenium to handle job listings and interviews that ask for it. Many existing company test suites still use Selenium, so knowing both widens your options.
Stage notes
- What Selenium is — an older, widely used browser automation tool. It drives browsers through WebDriver, a standard way for code to control a browser.
- Language — Selenium is most often used with Java or Python in job listings, but it also works with JavaScript/TypeScript (
selenium-webdriverpackage). Start in TypeScript so you only learn the tool, not a new language. - Key differences from Playwright — Selenium doesn't auto-wait, so you must add explicit waits (
driver.wait(until.elementLocated(...))). It has no built-in test runner, trace viewer or report; those come from other tools (Mocha, Jest, TestNG, JUnit). - Core commands —
driver.get(),findElement(By.id / By.css / By.xpath),click(),sendKeys(),getText(),quit(). - Page Object Model — works the same way as in Playwright. Your Stage 5 knowledge carries over.
- Selenium Grid — runs tests across many browsers and machines. Know what it is; you don't need to set one up.
- Be ready to explain why a team might pick Playwright or Selenium: Playwright is faster to write and more stable thanks to auto-waiting; Selenium has a longer history, more languages and huge existing suites.
Practice exercises:
Stage 10 — Professional level 0 of 15
be able to show, not just say, that you can do the job.
Stage notes
A test strategy is a short document in your project explaining what you tested, what you didn't and why, which browsers, and the known risks. Write one page.
What professionals do beyond the basics:
- Review other people's test code and accept review of their own.
- Keep tests fast, independent and readable; delete tests that no longer add value.
- Choose what to automate: stable, repeated, high-risk flows first; leave one-off and visual judgment checks to manual and exploratory testing.
- Track flaky tests and fix causes instead of adding retries.
- Talk to developers in their terms: commits, pull requests, CI runs, traces.
Keep growing after this guide: Routes 2 (API testing), 3 (Git, GitHub Actions and SQL) and 4 (AI-assisted QA) build directly on this work.
Portfolio Project 1 checklist (from the guide)
Interview readiness — be able to answer and demonstrate
Official resources
- Playwright docs: https://playwright.dev/docs/intro
- TypeScript Handbook: https://www.typescriptlang.org/docs/handbook/intro.html
- Selenium docs: https://www.selenium.dev/documentation/
- GitHub Skills: https://skills.github.com
- Practice sites: https://www.saucedemo.com, https://demo.playwright.dev/todomvc, https://the-internet.herokuapp.com, https://restful-booker.herokuapp.com
Video courses (free)
- TestGuild — UI Automation with Playwright using TypeScript — free course for complete beginners up; follow alongside Stages 3–8.
- LambdaTest — Complete Playwright Testing Tutorial with TypeScript — about 5 hours 41 minutes on YouTube, installation to advanced features.
Video courses (low-cost)
- Udemy — Playwright: Web Automation Testing From Zero to Hero by Artem Bondar — TypeScript, Page Objects, API testing and mocking, fixtures, visual testing; 76 lectures, about 12 hours, with coding exercises (Stages 3–8). Udemy prices change often and drop during sales; check before buying.
Shown to everyone. File: Playwright Training Guide — Beginner to Professional.md, updated 11 Nov 2026.