Lesson 12 — Automation

Test Automation Basics

Test automation uses code to execute test cases and verify results, enabling tests to run quickly, consistently, and frequently — often as part of every code change.

What Makes a Good Automation Candidate

Not every test should be automated. The best candidates are tests that are repetitive, stable (unlikely to change frequently), and business-critical, since these justify the upfront investment of writing and maintaining automated test code.

Categories of Automation Tools

Different tools target different levels of the testing pyramid, from fast in-code unit tests to browser-driven UI tests.

  • Unit testing frameworks — JUnit (Java), PyTest (Python), Jest (JavaScript).
  • API testing tools — Postman, REST Assured, for testing backend endpoints directly.
  • UI automation tools — Selenium, Playwright, Cypress, for driving a real browser.

Common Mistakes

  • Automating fragile, frequently changing UI flows before they've stabilised, resulting in constant test maintenance.
  • Writing automated tests with no clear assertions, so they technically "pass" without actually verifying anything meaningful.
  • Building an automation suite so slow that developers stop running it regularly, defeating its purpose.
  • Choosing a tool based on popularity alone without considering whether it fits the specific tech stack and testing level needed.

Professional Tip

Start automation efforts with the application's most business-critical, stable flows — like login or checkout — rather than trying to automate everything at once. A smaller, reliable suite delivers more value than a large, flaky one.

Your Turn

For an online banking app, identify three flows that would make excellent automation candidates, and one that would be a poor candidate for automation right now.

Mini Quiz

Which characteristic makes a test a good candidate for automation?