Test Case Template: How to Write Test Cases in 2026 (Example)
Free test case template plus a step-by-step guide to writing effective test cases: fields explained, worked login example, do's and don'ts, tools (TestRail, Zephyr, Xray), and interview-ready patterns.

Last updated: July 17, 2026 · 12 min read · By Avinash Kamble, reviewed by Priyanka G.
A test case is the single most important QA artefact — it turns a fuzzy requirement into a repeatable, reviewable, automatable check. Write them well and your regression pack becomes a moat around the product. Write them badly and even senior engineers cannot tell what “pass” means. This guide gives you the fields every test case needs, a copy-paste template, a filled-in login example, tool recommendations, and the six mistakes that get test cases rejected in reviews.
Pair with the test plan template and the software testing interview questions pillar.
Key takeaways
- Every test case needs 7 fields: ID, title, preconditions, steps, expected result, actual result, status.
- One test case = one specific check. Split, don't cram.
- Expected result must be observable and unambiguous — no “works fine”.
- Store in TestRail, Zephyr, Xray, or Git — never spreadsheets in email.
1. The 7 mandatory test case fields
- ID — unique identifier (
TC-LOGIN-001). - Title — one sentence naming what is being verified.
- Preconditions — state the system must be in before you execute (user exists, cart is empty, feature flag on).
- Test steps — numbered, atomic actions a stranger could follow.
- Test data — the exact inputs (email, password, order value).
- Expected result — the observable outcome, written before execution.
- Actual result & status — filled in on execution: Pass, Fail, Blocked, or Skipped.
2. Copy-paste test case template
+---------------------------------------------------------------------+
| TEST CASE |
+---------------------------------------------------------------------+
| ID: TC-[module]-[NNN] |
| Title: [Verify that ...] |
| Priority: P0 / P1 / P2 |
| Type: Functional / Regression / Smoke / Negative |
| Author: [Your name] · Reviewed by: [QA lead] |
| |
| PRECONDITIONS |
| 1. [Precondition 1] |
| 2. [Precondition 2] |
| |
| TEST DATA |
| - [key1]: [value1] |
| - [key2]: [value2] |
| |
| STEPS |
| 1. [Atomic action] |
| 2. [Atomic action] |
| 3. [Atomic action] |
| |
| EXPECTED RESULT |
| [Observable, specific outcome] |
| |
| ACTUAL RESULT |
| [Filled at execution] |
| |
| STATUS: [Pass / Fail / Blocked / Skipped] |
| DEFECT: [JIRA-1234 if failed] |
+---------------------------------------------------------------------+3. Worked example: login test case
ID: TC-LOGIN-002
Title: Verify user cannot log in with invalid password
Priority: P0
Type: Negative · Functional
PRECONDITIONS
1. User ‘valid@test.com’ exists and is active
2. Application is deployed to QA env at qa.example.com
TEST DATA
- Email: valid@test.com
- Password: WrongPass123!
STEPS
1. Navigate to https://qa.example.com/login
2. Enter the email into the ‘Email’ field
3. Enter the wrong password into the ‘Password’ field
4. Click the ‘Sign in’ button
EXPECTED RESULT
- HTTP response: 401 Unauthorized
- UI shows “Invalid email or password” error inline under the password field
- Failed attempt is logged in the audit table
- User remains on /login page
STATUS: [Pass]Notice how the expected result is observable at three layers — HTTP, UI, and DB. That is what makes the case automatable and reviewable.
4. Do's and don'ts every reviewer checks
Do:
- Write one assertion per test case. Compound checks hide failures.
- Make steps atomic — “click Save”, not “save the form and check the toast and refresh the page”.
- Include negative and edge cases, not just happy paths — use BVA and equivalence partitioning.
- Version cases in Git or a proper TCM tool.
Don't:
- Write vague expected results (“works fine”, “shows correctly”).
- Chain preconditions from another case — each case runs standalone.
- Duplicate cases across suites — use tags or shared library instead.
- Store cases in email or spreadsheets scattered on Slack.
5. Test case management tools in 2026
- TestRail — market leader, mature reporting, strong Jira sync.
- Zephyr Scale / Zephyr Squad — Jira-native, best for Atlassian-first teams.
- Xray for Jira — powerful requirements traceability, popular in enterprise.
- qTest, PractiTest — enterprise alternatives.
- Markdown in Git — increasingly popular for tech-first teams; test cases live next to code and code-review the same way.
See our test management tools comparison for a deeper breakdown.
6. From test case to automated script
A well-written manual test case translates 1:1 to Playwright, Selenium, or REST-Assured. Steps become actions, expected result becomes assertions:
test('user cannot log in with invalid password', async ({ page, request }) => {
await page.goto('https://qa.example.com/login');
await page.getByLabel('Email').fill('valid@test.com');
await page.getByLabel('Password').fill('WrongPass123!');
const [response] = await Promise.all([
page.waitForResponse('**/api/login'),
page.getByRole('button', { name: 'Sign in' }).click(),
]);
expect(response.status()).toBe(401);
await expect(page.getByText('Invalid email or password')).toBeVisible();
await expect(page).toHaveURL(/\/login$/);
});Level up with the Playwright complete guide and the Playwright interview questions hub.
7. Your 24-hour action step
Pick a feature from your current sprint. Write 5 test cases using the template above — 3 positive, 2 negative. Get a peer to review. Then rehearse test-case-writing questions on the AI Mock Interview, audit your resume with the ATS Resume Reviewer, and benchmark your comp on the QA Salary Guide. Reference: the ISTQB Foundation syllabus covers test case design in exam depth.
Frequently asked questions
1.What is a test case in software testing?
2.What are the mandatory fields in a test case?
3.How do I write a good expected result?
4.What is the difference between a test case and a test scenario?
5.Which tools are best for managing test cases in 2026?
Practice these questions
Run a live QA mock interview tailored to this topic and get per-skill scoring in minutes.
Was this article helpful?
More from Test Case Writing
Effective test cases, templates, examples.
- Career & Interview PrepThe 3-Minute Whiteboard Testing Trick That Impresses Interviewers (ACCORD Framework)
- AI in TestingHow to Use Claude AI for Test Case Generation (2026 Guide + Prompts)
- AI in TestingChatGPT Test Plan in 2026: The Complete Playbook (IEEE 829 Template, Risk Matrix, RACI & FAQ)
Keep building your QA edge
Pillar guides- AI Mock Interviewpractice these questions with our AI mock interviewLive AI-powered mock interviews with rubric feedback.
- ATS Resume Reviewcheck your ATS score instantlyFree AI ATS scoring with rewrite suggestions.
- QA Jobs Radarbrowse live QA job listingsLive QA / SDET / automation job feed, refreshed daily.
Continue reading

What Is Software Testing? The Complete 2026 Guide for QA Engineers
16 min read
Types of Software Testing — Functional vs Non-Functional (25+ Types Explained, 2026)
18 min read
Software Testing Life Cycle (STLC) — 6 Phases with Entry & Exit Criteria (2026 Guide)
14 min readJoin the QA Community
Connect with fellow testers, share job leads, and get career advice.
Stop Reinventing the Wheel. Upgrade Your QA Arsenal.
Take your testing skills from beginner to Lead Engineer. Supercharge your daily workflow with our premium digital resources.
- Ready-to-use testing strategy templates
- Advanced API & UI automation guides
- ⏱️ Save 10+ hours a week on test planning