Testing fundamentals

UI Test Cases for Web Apps: Examples, Template and Checklist (2026)

Robonito TeamRobonito Team 11 min read
UI test cases for web apps: a Robonito agent fills a web form, heals a changed selector and checks each step

The sprint demo went well. Then someone opened the sign-up form on a phone, typed an email with a trailing space, and got a blank red box with no message. The team had tested the feature, not the screen.

This guide gives you the missing piece: a template, 38 worked examples and a checklist you can print.

UI test cases for a web app are written checks that confirm each screen looks and behaves correctly for a real user: forms validate input, navigation goes where it should, layouts hold at every screen size, controls work by keyboard, sessions start and end safely, and errors explain themselves. Each case has an ID, preconditions, steps, an expected result and a priority.

Key takeaways

  • A good UI test case has one purpose, exact steps, a single observable expected result, and the test data it needs.
  • Group cases by area (forms, navigation, layout, accessibility, auth, errors, security) so gaps are easy to spot.
  • Mark priority honestly. Your P1 cases are your smoke suite and the first ones to automate.
  • Write steps in plain language a new tester could follow. The same wording can become an automated test.

What is a UI test case?

A UI test case is a single, repeatable check of something a user sees or does on screen. It names the starting state, the actions to take and the result you expect, so two different testers get the same answer.

UI test cases sit inside the wider practice of UI testing, which also covers visual regression, cross-browser runs and tooling. This post stays narrow: what to write down.

New to writing test cases? Our guide on how to write test cases in manual testing covers the basics this post builds on.

What should a UI test case template include?

Seven fields cover almost every UI check, in a spreadsheet, a test management tool or a table like this.

FieldWhat to writeExample
IDArea prefix and number, never reusedFRM-03
TitleWhat is checked, in under ten wordsEmail field rejects invalid format
PreconditionsState before step 1: page, user, data, browserLogged out, on /signup, desktop Chrome
StepsNumbered actions, one per line1. Type "anna@example" in Email. 2. Move focus to Password.
Expected resultOne observable outcomeInline message "Enter a valid email address" under Email; field has error styling
PriorityP1 (blocks release), P2 (fix before next release), P3 (cosmetic)P1
Test dataExact values, or where to get themanna@example, anna@example.com

Copy-ready blank template

IDTitlePreconditionsStepsExpected resultPriorityTest data
1.
2.
3.

Write one expected result per case, name exact data rather than "a valid email", and record browser and screen size in the preconditions, because UI bugs are often specific to both.

Example UI test cases for forms and validation

Forms are where most UI defects hide, because every field has a valid range, an invalid range and an edge. These eight cases cover a typical sign-up or checkout form.

IDTest caseExpected resultPriority
FRM-01Submit the form with every required field emptyEach required field shows its own error message; nothing is submittedP1
FRM-02Submit with all fields validSuccess state shown; data saved once; no duplicate on double-clickP1
FRM-03Enter "anna@example" in EmailInline format error appears when focus leaves the fieldP1
FRM-04Enter " anna@example.com " with spacesSpaces are trimmed or a clear message explains the problemP2
FRM-05Type one character past the field's maximum lengthInput stops at the limit or a message shows the limitP2
FRM-06Paste a 500-character string with emoji and accents into NameField accepts or rejects it cleanly; layout doesn't breakP2
FRM-07Trigger an error, then correct the valueError message and styling clear without a page reloadP2
FRM-08Submit, then press the browser Back buttonForm returns in a sensible state; no silent resubmissionP2

FRM-02 takes ten seconds and catches duplicate orders from impatient double-clicks.

Example UI test cases for navigation

Navigation cases confirm that every route a user can take goes somewhere real and comes back cleanly.

IDTest caseExpected resultPriority
NAV-01Click every item in the main menuEach opens the correct page with the correct page titleP1
NAV-02Open a deep link (e.g. /orders/123) while logged outRedirect to login, then back to /orders/123 after sign-inP1
NAV-03Visit a URL that doesn't existA helpful 404 page with a route back to the appP2
NAV-04Use browser Back and Forward across three pagesEach step shows the right page and scroll positionP2
NAV-05Refresh the page mid-way through a multi-step flowUser stays on the same step or gets a clear restart messageP2

Example UI test cases for layout and responsive design

Layout cases are the ones teams skip and users notice first. Run them at phone, tablet and desktop widths.

IDTest caseExpected resultPriority
LAY-01Load the main pages at phone widthNo horizontal scrolling; nothing cut offP1
LAY-02Open the menu at phone widthMenu opens, closes, and every link can be tappedP1
LAY-03Zoom the browser to 200%Text remains readable and controls stay usableP2
LAY-04Show the longest realistic value (long name, large number) in cards and tablesText wraps or truncates with a tooltip; no overlapP2
LAY-05Load a page with empty data (new account)A designed empty state, not a broken gridP3

For LAY-01, WCAG 2.2's Reflow criterion (1.4.10) sets a useful benchmark: content should work without two-dimensional scrolling at a width equivalent to 320 CSS pixels. Our guide to browser testing covers which browsers to run these on.

Example UI test cases for accessibility basics

These six cases don't replace an accessibility audit, but they catch the failures that block real users. Each maps to a success criterion in WCAG 2.2, which the W3C published as a Recommendation on 12 December 2024.

IDTest caseExpected resultPriority
A11Y-01Complete the main flow using only the keyboardEvery action is possible without a mouse (WCAG 2.1.1)P1
A11Y-02Tab through the pageFocus indicator is always visible (WCAG 2.4.7)P1
A11Y-03Check every form fieldEach has a visible label or instruction (WCAG 3.3.2)P1
A11Y-04Trigger a validation errorThe field in error is identified and the error is described in text, not colour alone (WCAG 3.3.1)P1
A11Y-05Check body text contrastAt least 4.5:1 for normal text (WCAG 1.4.3)P2
A11Y-06Check icon buttons and imagesEach has a text alternative (WCAG 1.1.1); tap targets are at least 24 by 24 CSS pixels (WCAG 2.5.8)P2

Scanners help but don't finish the job. The open-source engine axe-core says it finds on average 57% of WCAG issues automatically, so keyboard and screen-reader checks still need a person. Our post on manual accessibility testing covers the rest.

Example UI test cases for login and sessions

Authentication screens combine UI behaviour with security rules, so test both. These cases follow guidance in the OWASP Authentication and Session Management cheat sheets.

IDTest caseExpected resultPriority
AUTH-01Log in with valid credentialsLands on the dashboard with the right user name shownP1
AUTH-02Log in with a wrong password, then with an unknown emailBoth show the same generic message (e.g. "Invalid user ID or password")P1
AUTH-03Paste a password from a password managerPaste works in the username, password and MFA fieldsP2
AUTH-04Log out, then press BackProtected page isn't shown; user is asked to log in againP1
AUTH-05Stay idle past the session timeout, then clickSession has ended; user is sent to login with a clear messageP2
AUTH-06Fail login repeatedlyThrottling or lockout starts, with a message that doesn't reveal whether the account existsP2

Example UI test cases for error states

Error states are part of the UI, and the ones users remember.

IDTest caseExpected resultPriority
ERR-01Disconnect the network, then submit a formA clear "you're offline" or retry message; typed data is keptP1
ERR-02Force a server error (500) on a save actionFriendly message, no stack trace, no internal detailsP1
ERR-03Throttle the network to a slow connection and load a pageLoading indicators appear; no layout jumps when content arrivesP2
ERR-04Upload a file of the wrong type and one over the size limitEach is rejected with a message that says whyP2

Which security test cases belong in UI testing?

Some security checks are visible from the browser and fit in a UI suite as cheap tripwires. They don't replace scanning or penetration testing, which our guide to web application security testing covers.

IDTest caseExpected resultPriority
SEC-01Enter <script>alert(1)</script> in a text field, save, and view itShown as plain text; no script runsP1
SEC-02As a standard user, open an admin URL directlyAccess denied page, not the admin screenP1
SEC-03Check the URL bar and page source after login and payment stepsNo passwords, tokens or personal data in the URLP1
SEC-04Load the login page inside an iframe on another originThe page refuses to render in the frameP2

SEC-04 checks clickjacking protection. The OWASP Clickjacking Defense cheat sheet recommends sending Content-Security-Policy: frame-ancestors and X-Frame-Options headers, and notes that meta-tag versions of X-Frame-Options don't work.

Printable UI testing checklist

Use this before every release or paste it into your pull request template. Each line maps to cases above.

Forms

  • Required fields show their own error when empty
  • Valid submit saves once, even on double-click
  • Format, length and whitespace edges are handled
  • Errors clear when the value is corrected

Navigation

  • Every menu link opens the right page and title
  • Deep links survive login
  • 404 page offers a way back
  • Back, Forward and Refresh don't break flows

Layout

  • No horizontal scroll at phone width
  • 200% zoom keeps content usable
  • Long values and empty states look designed

Accessibility

  • Whole flow works by keyboard, with visible focus
  • Every field has a label; errors are described in text
  • Text contrast and tap target sizes checked

Login and session

  • Generic login error for wrong password and unknown user
  • Logout and timeout end the session; Back doesn't reveal data
  • Paste works in login fields

Errors and security

  • Offline, 500 and slow-network states handled
  • Script input renders as text
  • Direct URLs respect permissions
  • No sensitive data in URLs; page can't be framed by other sites

How do you prioritise UI test cases?

Mark a case P1 if a failure stops a core task or puts data or security at risk, and run it on every build. P2 cases hurt trust or accessibility and run before each release. P3 is cosmetic. Your P1 cases are your smoke suite and the first ones to automate.

How do you turn UI test cases into automated tests?

Keep the wording you already have. A well-written manual case is already a script: a starting state, ordered actions and an expected result.

Robonito's AI Studio lets you describe a test in plain text, paste a URL or reference a Jira issue, and the agent works through the app step by step. Plain text to test case is on every plan, including Free. Here are four of the examples above, written the way you would describe them.

FRM-03, email format

  1. Go to the sign-up page.
  2. Type "anna@example" in the Email field.
  3. Click into the Password field.
  4. Check that the message "Enter a valid email address" appears under Email.

NAV-02, deep link after login

  1. While logged out, open /orders/123.
  2. Check that the login page appears.
  3. Log in as the test customer.
  4. Check that the order 123 page opens.

AUTH-04, logout and Back

  1. Log in as the test customer and open the account page.
  2. Click Log out.
  3. Press the browser Back button.
  4. Check that the account page is not shown and the login page is.

SEC-02, direct admin URL

  1. Log in as a standard user.
  2. Open the admin settings URL directly.
  3. Check that an access-denied message appears and no admin controls are visible.

Once a case runs, self-healing keeps steps working when labels, layouts or locators change, and logs each healed step for review. Each run keeps video, network traces and an AI root cause for failures.

Where Robonito fits, and where it doesn't

Robonito fits teams that already have test cases in documents or Jira and want them running without writing framework code. Web testing is on every plan, and you can build tests from plain text, by recording in the desktop app, or from reusable no-code steps. On Starter and above, suites run from Jenkins, GitHub Actions, GitLab CI or Azure DevOps.

It doesn't replace everything on this page. Accessibility still needs a person with a keyboard and a screen reader. The security cases are tripwires, not a penetration test, and Robonito isn't a security scanner. Deciding which cases matter is still your job.

See how it works on the web testing solution page, compare plans on pricing, or with your own P1 cases.

Frequently asked questions

What are test cases for UI?

UI test cases are written checks of what a user sees and does on screen: forms, navigation, layout, accessibility, login and error states. Each one has an ID, preconditions, steps, a single expected result, a priority and test data, so anyone can repeat it and get the same answer.

How many UI test cases does a web app need?

There's no fixed number. Start with one P1 case per core user task, then add cases for each form field's edges, each navigation route, each screen size you support and each error state. Count matters less than coverage: every high-risk journey should have at least one P1 case.

What should a UI testing checklist include?

At minimum: required-field and format validation, duplicate-submit protection, navigation and deep links, phone-width layout, keyboard access and visible focus, field labels, contrast, login errors, logout and timeout, offline and server-error states, and a few security tripwires such as script input and direct admin URLs.

What is the difference between a UI test case and a functional test case?

A functional test case checks that a feature produces the right result, often through any interface, including an API. A UI test case checks the result through the screen: what appears, where, how it responds to input and whether everyone can use it. Many cases are both.

Which security test cases can you run through the UI?

Ones a browser can observe: script input rendering as text, standard users blocked from admin URLs, generic login errors, sessions ending on logout and timeout, no sensitive data in URLs, and the page refusing to load in another site's iframe. Deeper checks need security scanners and penetration testing.


Turn your UI test cases into tests that run on every release. , or and automate your first five today.

No-code AI test automation

Spend less time testing and more time shipping.

Club Car cut its QA testing time by over 70% with Robonito. Start on the Free plan, which stays free forever, or book a demo and we'll walk through your own app.

All blog posts