Test cases for a website: examples and a template
A test case is a set of steps that tests one function: an ID, preconditions, steps, test data and the expected result. A test scenario is the broader thing you want to test, and one scenario usually has several test cases. TesterAgent generates test cases from the functions it finds on your site, runs them automatically and exports them as CSV that opens in Excel or Google Sheets.
Test case vs test scenario vs test script
| Term | What it is | Example |
|---|---|---|
| Test scenario | What to test, in one line | Users can log in |
| Test case | Exact steps, data and expected result | Log in with a valid email and password → dashboard opens |
| Test script | The automated code that runs a test case | A Playwright script |
Five example test cases
| ID | Function | Steps | Expected result |
|---|---|---|---|
| TC-001 | Login form | Open /login, enter a valid email and password, press Sign in | The account page opens; no error |
| TC-002 | Search | Type a product name that exists, press Enter | Results list the product |
| TC-003 | Contact form | Submit with the email field empty | A clear message says the email is required |
| TC-004 | Language switch | Switch to Lao on the home page | The same page opens in Lao; no English left |
| TC-005 | 404 page | Open a URL that does not exist | A 404 page with links back; status 404 |
CSV template
Use these columns: id, function, page, preconditions, steps, test_data, expected, actual, status. One row per test case; keep IDs stable so you can compare runs.
Generate them automatically
On Pro and Business, TesterAgent finds your site’s functions and writes these test cases for you. See the test case generator.