Pick one programming language

A programming language is just a precise way of writing down instructions for a computer to follow — a bit like a recipe, except the computer will only do exactly what you wrote, not what you meant, so the wording has to be exact. It's necessary for test automation because a browser automation tool isn't a standalone app you click around in — it's a library you call from inside a programming language, using that language's own ordinary building blocks (variables, loops, if-statements) to say things like "open this page," "click this button," "check that this text appeared." Learning browser automation already means learning a new tool and a testing mindset at the same time, so don't also try to learn a brand-new programming language in the same sitting — pick whichever of these you're already somewhat comfortable with:

  • JavaScript — the most common language for web testing; if you've written any web front-end code, start here.
  • Python — clean, readable syntax; a popular second choice, especially outside web-development teams.

Examples you can ask AI

  • I've never written a line of code before. Could you explain, in plain terms, what JavaScript and Python are each generally used for, and recommend one to start with for browser testing?
  • I already know a bit of JavaScript — what would I need to learn differently to write a browser automation script in it, and what's a good small first exercise?
  • I'm already comfortable in one of these languages — what are the real trade-offs of switching to the other one specifically for a growing browser-test suite, not just for general-purpose programming?

Pick one browser automation tool to start

Browser automation means controlling a real web browser with code instead of a mouse and keyboard — opening a page, clicking a button, filling in a form, reading back what's on the screen, all done programmatically. It's necessary for test automation because it's what makes a check repeatable: instead of a person clicking through your site by hand every time something changes and hoping they remember every step, a script does the exact same clicks in the exact same order every single time, and tells you the moment something doesn't look right. A browser automation tool is the library that gives your programming language the vocabulary to do this — find an element, act on it, wait for it, check it. Start with exactly one of these — you can learn the others later once the core ideas click:

  • Playwright — the friendliest choice for beginners today. Good documentation, built-in auto-waiting (see step 4), works the same way across Chromium, Firefox, and WebKit, with official bindings in JavaScript, Python, and more.
  • Selenium — the most established and most widely taught browser automation tool, with the largest ecosystem and the most existing tutorials, courses, and Stack Overflow answers.

Examples you can ask AI

  • I've never automated a browser before. In plain terms, what do Playwright and Selenium each actually do, and which one is easiest to get running today?
  • I want to automate a multi-step checkout flow with a loading spinner between steps — which of Playwright or Selenium handles that kind of waiting most simply?
  • I need a test suite that runs reliably in parallel across Chromium, Firefox, and WebKit — how do Playwright and Selenium actually differ in how they handle that?

Install it and run one script against this site

Follow your chosen tool's own "getting started" guide to install it, then point your very first script at the practice page https://testingexamples.github.io/en-001/practice/. This site was built for exactly that: every element on the practice page has a stable id, name, class, or link text you can practice finding — no guesswork about whether the markup will change under you.

A reasonable first script: open the practice page, find the element with id id-example-1, and print or assert its text. Then try finding an element by name, by class, and by link text. Small, deliberate wins first.

Examples you can ask AI

  • I've just installed a browser automation tool for the first time and I'm stuck on an installation error — what are the most common first-run problems and how do I fix them?
  • My first script found one element fine, but I also want it to click a link and then check the resulting page's title — what's a clean way to write that as a second step?
  • I want my very first script to also run headless and take a screenshot automatically on failure — what's the minimal setup to add both?

Practice on real, deliberately-friendly examples

Once the basics click, read other people's working code line by line. This project's sibling repos are worked examples built for exactly that:

Locator-strategy walkthroughs (target this site)

Then read this site's own worked examples, which tour the same handful of interactions across two tools and three languages, including Rust:

Examples you can ask AI

  • I've read one of these worked examples line by line but I don't understand what a specific line does — what's a good, safe way to ask an AI assistant to explain unfamiliar code like that?
  • I want to take a worked example written in one language and rewrite it in another to practice — what's a good way to check my rewrite is actually equivalent, not just similar-looking?
  • I want to turn a walkthrough example that only prints what it found into a real test with proper assertions — what's a reliable way to decide what's actually worth asserting?

A note on real third-party sites

Examples you can ask AI

  • Why exactly is it riskier to run an automated script against a real live website like Google than against a page built for practicing on?
  • I want to practice against a real site respectfully — what guardrails, like rate limiting, robots.txt, and terms of service, should I check before running anything at all, even occasionally?
  • I want to build my own small, stable practice site instead of relying on someone else's — what's the minimum it needs to be genuinely useful for locator practice?

See the Google Search examples → See the Google Maps examples →