Test case template (with examples)
A free test case template with every field explained, three filled-in examples, tips for writing good test cases and how to set it up in Excel or Sheets.
A test case template is a fixed set of fields that every test case fills in: an ID, a title, preconditions, steps, test data and the expected result. Using the same fields each time makes test cases easy to write, run and review, whoever wrote them.
Test case template
| Field | What to write | Example |
|---|---|---|
| ID | A short unique code | LOGIN-003 |
| Title | What is checked, in one line | Sign-in fails with a wrong password |
| Priority | How important the check is | High |
| Preconditions | What must be true before you start | A registered user exists; the user is signed out |
| Steps | Numbered actions, one per line | 1. Open the sign-in page. 2. Enter the email. 3. Enter a wrong password. 4. Select Sign in. |
| Test data | Exact values to use | Email: [email protected]; password: wrong-pass-1 |
| Expected result | What should happen, so anyone can judge pass or fail | The message "Wrong email or password" is shown; the user stays signed out |
| Actual result | What did happen (filled in when run) | |
| Status | Pass, fail or blocked (filled in when run) |
Test case examples
Three test cases written with the template, for sign-in and a discount code:
| ID | Title | Preconditions | Steps | Expected result |
|---|---|---|---|---|
| LOGIN-001 | Sign-in works with a valid email and password | Registered user; signed out | Open sign-in; enter the valid email and password; select Sign in | The dashboard opens and shows the user's name |
| LOGIN-003 | Sign-in fails with a wrong password | Registered user; signed out | Open sign-in; enter the valid email and a wrong password; select Sign in | An error message is shown; the user stays signed out |
| CART-012 | Expired discount code is refused | Cart total of 50 EUR; code OLD10 expired yesterday | Open the cart; enter OLD10; select Apply | The message says the code has expired; the total stays 50 EUR |
How to write good test cases
- 1One check per test case. If the title needs the word "and", split it.
- 2Write steps anyone can follow, without knowing the product. Name the page, the field and the button.
- 3Give exact test data. "A long name" is vague; "a name of 256 characters" is clear.
- 4Make the expected result something you can see, so pass or fail is not a matter of opinion.
- 5Keep each case independent, so it can run alone and in any order.
- 6Set a priority, so the critical cases run first when time is short.
Positive, negative and edge cases
- Positive case: the normal path works, such as sign-in with a valid password.
- Negative case: wrong input is handled well, such as a wrong password or an empty field.
- Edge case: the limits hold, such as the longest allowed name, an expired link or a double click.
One test scenario usually becomes two to five test cases of these three kinds. For the difference, see test scenario vs test case.
Test case template in Excel or Google Sheets
A spreadsheet works well for a small product. Use one row per test case and one column per field from the template above. For each test run, add three columns: status, tester and date. Group cases by feature on separate tabs, and freeze the header row.
Spreadsheets get hard to manage as the number of cases and runs grows: results from older runs are overwritten or copied to new tabs, and it is unclear which version is current. That is usually the moment to move to a test management tool.
Common mistakes
- Steps that depend on the result of another test case.
- Expected results such as "works correctly".
- Missing test data, so every tester uses different values.
- Only positive cases; no negative or edge cases.
- Cases that are never updated when the feature changes.
From template to tool
Tebugging offers smart test cases and AI-suggested test planning: it suggests scenarios and edge cases from your description, and you review and keep the ones that matter. Tests then run with automated execution and real-time monitoring. Read more in AI test case generation, or start from the website test plan guide.
Frequently asked questions
What should a test case include?+
An ID, a title, preconditions, numbered steps, test data and an expected result. When the test is run, add the actual result and a status of pass, fail or blocked.
How detailed should a test case be?+
Detailed enough that someone who does not know the feature can run it and reach the same verdict. Exact test data and a visible expected result matter more than long steps.
What is the difference between a test case and a test scenario?+
A test scenario is one line that says what should work. A test case is one exact check of it, with steps, test data and an expected result.
Can I use Excel for test cases?+
Yes. A spreadsheet with one row per test case is fine for a small product. As cases and test runs grow, a test management tool keeps results and versions easier to follow.
Keep reading
New to a term? See the QA and AI testing glossary.
Plan, run and analyze your web tests with AI.
Start on the free plan. No credit card required.
Start Testing Free