Free · Playwright · TypeScript

Test Automation Practice

Real UI elements to point your tests at, from text fields to custom dropdowns. Each topic gives you tasks to automate, a tip on how to locate every element, and a solution you can check your work against.

  1. Pick a topic and read the tasks under each element.
  2. Write your test against this site, using the setup below.
  3. Compare with the solution. Every solution is a real test that runs against these pages.

Topics

Ready

Inputs & Forms

Text fields, checkboxes, radio buttons, native and custom dropdowns, and form validation.

Start practising →
Ready

Buttons & Mouse Actions

Click, double-click, right-click, hover menus, tooltips, keyboard keys and button states.

Start practising →
Ready

Alerts & Dialogs

Browser alert, confirm and prompt boxes, plus in-page modal dialogs.

Start practising →
Ready

Frames & Windows

Iframes, nested iframes, new tabs and popup windows.

Start practising →
Ready

Web Tables

Static, sortable and paginated tables: find a row, read a cell, sum a column.

Start practising →
Coming soon

Waits & Dynamic Content

Elements that appear late or disappear, loading spinners and IDs that change on every load.

Coming soon

Scrolling

Infinite scroll, scrolling inside a box, and elements you must scroll into view.

Coming soon

Drag & Drop

Drag items between lists and reorder them.

Coming soon

File Upload & Download

Single and multiple file uploads, and downloads you can verify.

Coming soon

Date Pickers, Sliders & Auto-suggest

The tricky widgets: calendars, range sliders and search-as-you-type lists.

Coming soon

Links & Images

Find broken links and broken images, and check where links point.

Coming soon

Shadow DOM

Elements hidden inside open shadow roots and web components.

Coming soon

SVG & Canvas

Charts and icons drawn with SVG or canvas, which normal locators struggle with.

Coming soon

Login Flow

A fake login (runs entirely in your browser) with errors, a dashboard and logout.

Coming soon

Cookies & Storage

Read and set cookies and localStorage, and reuse a logged-in state between tests.

Set up Playwright

In an empty folder, run npm init playwright@latest and choose TypeScript. Then set baseURL in playwright.config.ts so your tests can open a topic with a short path like page.goto('/practice/forms'):

import { defineConfig } from '@playwright/test';

export default defineConfig({
  testDir: './tests',
  use: {
    baseURL: 'https://hiraanachwani.com',
  },
});

Run your tests with npx playwright test, or npx playwright test --ui to watch each step in the browser.

These pages stay stable: element labels, IDs and data-testids won't change once published, so your tests keep passing. Found a problem or want a topic added? Let me know.