QA Automation Hub

Tutorials › How to Write a Good Test Case (with Example)

How to Write a Good Test Case (with Example)

By the QA Automation Hub team, powered by AtumCode · Updated 2026-11-20

A test case is a short set of steps with an expected result. Anyone should be able to follow it and get the same answer.

The parts of a test case

Example: login with a wrong password

  1. Open the login page.
  2. Type the username admin.
  3. Type the password wrong123.
  4. Click Login.

Expected result: the user stays on the login page and sees the message "Invalid credentials".

Tips for better test cases

From test case to automation

A clear manual test case turns into an automated test almost line by line: each step becomes an action, and the expected result becomes an assertion.

Want to practise this step by step?
Our free Playwright course teaches it in simple English, one day at a time.
Open the free course