Test cases for login page: a copyable table

Test cases for a login page in one table: functional, negative, security, accessibility and usability cases, with the OWASP, NIST and WCAG rule behind each.

A smoked-glass slab with a keyhole opening stands behind six glass cubes, with the fourth cube from the left orange.

Test cases for a login page check five things: that the right person gets in, the wrong input is refused, attackers learn nothing, everyone can use the form, and it works on a phone. The tables below hold 56 cases with steps and expected results, and the security rules are taken from OWASP, NIST and WCAG rather than habit.

Before you copy the table

The cases share a few assumptions. Write them down in your own test case template before the first run, because a login expected result is only as exact as the policy behind it.

  • Test accounts. One active account, one locked, one disabled, one awaiting email confirmation, and one with a second factor enabled, each on a test environment. Never use a real person’s credentials, and never paste a password into a ticket.
  • The policy. The failure threshold and what happens after it, the session timeouts, the password length limits, whether email addresses are case-insensitive, whether spaces are trimmed. Where a case below says “per policy”, the expected result is the number in that document.
  • Two views of every result. What the user sees, and what the server did: whether a session cookie was set, which status code came back, whether the failure counter moved. The browser’s developer tools show both.

The general rules for writing a case that a stranger can run are in how to write test cases. The login form is still a form, so the checks for labels, validation and submission in the form testing guide apply to it as well; this page adds what is specific to signing in.

Functional and negative test cases

Functional cases prove the happy path and what follows a successful sign-in. Negative cases prove the page refuses what it should and creates no session when it does.

IDScenarioStepsExpected result
LGN-F01Valid email and password1. Open the login page. 2. Enter the active account’s email and password. 3. Select Sign in.Signed in and taken to the default page. Session cookie set. Login form no longer shown.
LGN-F02Enter key submits1. Fill both fields. 2. Press Enter in the password field.Same result as LGN-F01.
LGN-F03Return to the requested page1. Signed out, open a protected URL such as /settings. 2. Sign in when redirected.Returned to /settings, not to the default page.
LGN-F04Redirect parameter points off-site1. Open the login URL with the return address changed to an external domain. 2. Sign in.Redirect refused. User stays on the site’s own domain.
LGN-F05Remember me selected1. Tick Remember me. 2. Sign in. 3. Close and reopen the browser.Still signed in, for the period in the policy.
LGN-F06Remember me not selected1. Sign in without ticking it. 2. Close and reopen the browser.Session behaviour matches the policy for an unremembered session.
LGN-F07Sign out, then Back1. Sign in. 2. Sign out. 3. Press the browser’s Back button.Protected page not shown from cache. Reloading it asks for sign-in.
LGN-F08Already signed in, open the login page1. Sign in. 2. Open the login URL directly.Taken into the app, or offered to sign out. No second login form over a live session.
LGN-F09Email typed in upper case1. Enter the account’s email in capitals. 2. Enter the correct password. 3. Sign in.Matches the documented rule for email case. Record which rule applies.
LGN-F10Forgot password link1. Select Forgot password.Reset page opens. The link is visible next to the password field.
LGN-F11Second factor, correct code1. Sign in with the account that has a second factor. 2. Enter the current code.Access granted only after the code. No session before it.
LGN-F12Social or single sign-on button, if offered1. Select the provider button. 2. Complete the provider’s sign-in.Returned signed in to the same account the provider’s email belongs to.
LGN-N01Wrong password1. Enter the active email and a wrong password. 2. Sign in.Generic error. No session cookie. Failure counter increases.
LGN-N02Unknown email1. Enter an email with no account and any password. 2. Sign in.Exactly the same message and status code as LGN-N01.
LGN-N03Both fields empty1. Select Sign in with nothing entered.Each field shows its own error. No request reaches the server, or the server refuses it.
LGN-N04Email empty1. Enter only a password. 2. Sign in.Email field error. Password field keeps its value.
LGN-N05Password empty1. Enter only an email. 2. Sign in.Password field error.
LGN-N06Whitespace only1. Enter spaces in both fields. 2. Sign in.Treated as empty.
LGN-N07Malformed email1. Enter user@ or user.example.com. 2. Sign in.Format error on the email field, naming the expected format.
LGN-N08Password in the wrong case1. Enter the correct password with its case changed after the first character. 2. Sign in.Refused, the same as LGN-N01.
LGN-N09Locked account, correct password1. Sign in with the locked account.No session. Response follows the policy and does not confirm the account exists to a stranger.
LGN-N10Disabled account, correct password1. Sign in with the disabled account.No session. Response follows the policy.
LGN-N11Unconfirmed account1. Sign in with the account awaiting email confirmation.No access to protected pages. Prompt to confirm or resend the email.
LGN-N12Wrong or expired second-factor code1. Sign in with the second-factor account. 2. Enter a wrong code, then an expired one.Refused both times. Attempts counted toward the limit.
LGN-N13Double submit1. Fill both fields. 2. Double-click Sign in.One request, one session.

LGN-N08 changes the case after the first character on purpose. NIST SP 800-63B allows a verifier to accept a password whose leading character differs in case, as a limited allowance for mistyping, so a capital first letter typed by mistake may correctly be accepted. Check the policy before filing that one.

Security test cases, with the rule behind each

These are the cases the popular lists cover least, and the ones that matter most. Each expected result comes from the OWASP Authentication Cheat Sheet or from NIST SP 800-63B (revision 4, the current version, read on 16 November 2026).

IDScenarioStepsExpected result
LGN-S01Page served over plain HTTP1. Open the login URL with http:// in place of https://.Redirected to HTTPS before the form appears. OWASP: the login page and every authenticated page must be served only over TLS.
LGN-S02Enumeration by message1. Run LGN-N01 and LGN-N02. 2. Compare the text.Identical. OWASP asks for a generic answer, in the HTML and in the HTTP response, whether the user exists or not.
LGN-S03Enumeration by status code1. Repeat LGN-S02 with the Network panel open. 2. Compare status codes.Identical. OWASP notes a differing response code can leak whether an account is valid even when the page looks the same.
LGN-S04Enumeration through password reset1. Request a reset for a real and an unknown email.Same message for both. OWASP applies the generic answer to login, password reset and recovery.
LGN-S05Repeated failures are limited1. Submit a wrong password repeatedly on one account.Throttling starts at the documented threshold. NIST requires no more than 100 consecutive failed attempts per authenticator, and allows lower limits.
LGN-S06Lockout cannot be used against users1. Trigger the limit on an account from a second browser or network. 2. Try the real owner’s path.The owner has a documented way back in. OWASP warns that a lockout design must not let an attacker lock other users out.
LGN-S07Long passphrase1. On a test account, set a 64-character passphrase. 2. Sign in with it.Accepted. OWASP, citing NIST, says the maximum length should be at least 64 characters.
LGN-S08No silent truncation1. With the LGN-S07 account, sign in with the passphrase minus its last character.Refused. OWASP: do not silently truncate passwords.
LGN-S09Spaces and Unicode in the password1. Set a password containing spaces and a non-Latin character. 2. Sign in with it.Accepted. OWASP: allow all characters, including Unicode and whitespace.
LGN-S10Paste into every field1. Paste the email, the password and the second-factor code from a text editor.Paste works in all three. OWASP asks sites to allow paste in the username, password and MFA fields.
LGN-S11Password manager fills the form1. Save the credentials in the browser’s password manager. 2. Return to the login page.Both fields fill and the form submits. NIST: verifiers shall allow password managers and autofill.
LGN-S12SQL fragment in the email field1. Enter ’ OR ‘1’=‘1 as the email. 2. Sign in.Generic failure. No database error or stack trace on the page.
LGN-S13Script in the email field1. Enter a script tag as the email. 2. Sign in.Shown back as text, if at all. Never run.
LGN-S14Browser checks removed1. In DevTools, remove the field’s required and maxlength attributes. 2. Submit empty, then oversized, input.The server refuses both. The server is the control; client-side checks only help the user.
LGN-S15Password kept out of the URL1. Sign in with the Network panel open. 2. Inspect the request.Sent in the body of a POST. Never in the query string or the address bar.
LGN-S16Session identifier changes at sign-in1. Note the session cookie value before signing in. 2. Sign in. 3. Compare.A new value after sign-in. The pre-login value no longer works.
LGN-S17Idle timeout1. Sign in. 2. Leave the session idle past the policy’s timeout. 3. Act.Asked to sign in again. NIST’s AAL2 guidance is an inactivity timeout of no more than one hour and reauthentication at least every 24 hours.
LGN-S18Sign-out ends the session on the server1. Copy the session cookie. 2. Sign out. 3. Replay a request with the copied cookie.Refused. Sign-out that only clears the browser leaves the session usable.

Accessibility and usability test cases

A login form that cannot be completed with a keyboard or a screen reader shuts people out of the whole product. WCAG 2.2 Success Criterion 3.3.8, Accessible Authentication (Minimum), treats remembering a password as a cognitive function test, and passes a username and password form when the browser and password managers can fill it and users can paste. The usability rows come from Google’s sign-in form best practices.

IDScenarioStepsExpected result
LGN-A01Keyboard only1. Put the mouse away. 2. Tab through the form, sign in, open Forgot password.Logical focus order, visible focus on every control, every action reachable. See keyboard navigation.
LGN-A02Labels1. Click each label. 2. Listen with a screen reader.Focus moves to the field. Each field announces a visible label, not a placeholder. The W3C labels tutorial asks for a label whose for attribute matches the field’s id.
LGN-A03Error announced and tied to its field1. Run LGN-N01 with a screen reader on.The error is announced and stated in text. WCAG 3.3.1 Error Identification requires the error to be described in text.
LGN-A04Field purpose in code1. Inspect the two inputs.autocomplete=“username” on the email field and autocomplete=“current-password” on the password field, as web.dev recommends.
LGN-A05No puzzle without an alternative1. Trigger any CAPTCHA the form shows, for example after several failures.A path that does not need the puzzle. WCAG 3.3.8 allows only object recognition or content the user supplied as exceptions.
LGN-A06Show password control1. Reach the toggle by keyboard. 2. Activate it.Password shown and hidden. The control has an accessible name. The form does not submit, since web.dev notes a button inside a form defaults to type submit.
LGN-A07Error not shown by colour alone1. Run LGN-N03 in greyscale or with colour turned off.The error is still clear from its text.
LGN-U01Email keyboard on a phone1. Tap the email field on a phone.A keyboard with the @ sign, from type=“email”.
LGN-U02On-screen keyboard and the button1. Fill the password on a phone with the keyboard open.The Sign in button is still visible or reachable. web.dev shows the keyboard hiding it on some phones.
LGN-U03Button label1. Read the submit button.Says what it does, such as Sign in. Submit is too vague.
LGN-U04Button while fields are empty1. Load the page and look at the button before typing.Enabled, and pressing it explains what is missing. web.dev warns against a disabled button that leaves people tapping with no explanation.
LGN-U05Slow connection1. Throttle the network in DevTools. 2. Sign in.A loading state, one request, and a clear message if it times out.
LGN-U06Useful failure message1. Run LGN-N01.Generic about which part was wrong, and points to Forgot password.

Several widely copied login test sets carry expected results that the standards now contradict. A case built on one of them passes a broken page or fails a correct one.

  • “Account locked after five attempts for 30 minutes.” A fixed number from a blog is not an expected result. NIST sets an upper bound of 100 consecutive failures and suggests waits that grow as the account nears the limit, for example from 30 seconds up to an hour. OWASP describes exponential lockout as an option and warns about lockout used as denial of service. Test the threshold your policy states.
  • Rejecting a password at sign-in for lacking a symbol or a digit. NIST says other composition requirements shall not be imposed beyond the blocklist, and OWASP says there should be no composition rules limiting the type of characters. A login form has no business validating password strength at all; that belongs to the page where a password is set.
  • Expecting paste to be blocked. A case like that is a bug report against the standards. NIST says verifiers should permit paste, OWASP asks for it in every login field, and WCAG 3.3.8 fails a form that blocks password managers or paste without an alternative.
  • Treating space-trimming as a defect. NIST allows a verifier to remove leading and trailing whitespace before checking, as long as the result still meets the minimum length. The expected result is the documented rule, applied the same way at sign-up and sign-in.
  • Forcing a periodic password change at login. OWASP advises against requiring periodic changes and notes that NIST guidance says verifiers should not mandate arbitrary ones. A prompt to change a password that nobody suspects is compromised counts as a finding.

The form testing guide covers the checks every form shares, and web application testing places sign-in among the other layers of a release.

What to attach when a login case fails

A failed login case is reported with the case ID, the test account’s name (never its password), the browser, the exact message shown and a screenshot. Add the expected and actual result side by side, and for the security rows the evidence that decides them: the two status codes for an enumeration case, the request method for LGN-S15, the cookie values for LGN-S16.

Be careful with network exports. A HAR file saved from a login attempt contains the posted form data, which is the password, and the session cookies set after it. The post on HAR file security explains why one should never be attached as it is. The request line and its status code are what a developer needs.

Notarus evidence capture attaches the screenshot, console errors and network calls to a bug report, records each call as its result without the request or response body, and strips passwords, tokens and cookies from captured logs. Session replay never records typed characters. So a report from a failing login page arrives with the status codes and the steps, and without the credentials that were typed into it.

Common questions

What are the test cases for a login page?

Login page test cases fall into five groups: functional cases for a successful sign-in and what follows it, negative cases for wrong or missing input, security cases for enumeration, throttling, transport and sessions, accessibility cases for keyboard, labels and errors, and usability cases for mobile keyboards, button labels and slow networks. Each case names its steps and an exact expected result.

How do you write a test case for a login page?

Give each case an ID, one scenario, the account and data it starts from, numbered steps and an expected result specific enough that two testers reach the same verdict. Expected results for login should cover what the user sees and what the server did, such as whether a session cookie was set and whether the failure counter moved.

What are negative test cases for a login page?

Negative login cases check that the page refuses what it should: a wrong password, an unknown email, empty or whitespace-only fields, a malformed email, a password in the wrong case, a locked, disabled or unverified account, and a wrong or expired one-time code. In each, no session is created and the message gives nothing away about which part was wrong.

What security tests should a login page have?

At minimum, test that the page is served only over HTTPS, that an unknown user and a wrong password get the same message and status code, that repeated failures are throttled, that long passphrases and pasted passwords are accepted, that injection payloads fail safely, and that sign-out and idle timeouts end the session on the server.

Should a login page lock the account after failed attempts?

Failed attempts should be limited, but a fixed lockout is only one way to do it. NIST SP 800-63B caps consecutive failures at 100 per authenticator and allows growing waits between attempts, while the OWASP Authentication Cheat Sheet warns that lockout can be abused to lock real users out. Test against your documented policy.

How many test cases does a login page need?

The number depends on what the page offers. A plain email and password form needs the core functional, negative, security and accessibility cases, and every extra method, such as one-time codes, social sign-in or single sign-on, adds its own. Coverage of the risks matters more than the count, so start from the security block.

The Notarus team

The people who build Notarus. We write up the decisions behind the product when the reasoning is worth more than the changelog line.

Keep reading

Reports with the evidence attached.

Start free, one script tag.

<script src="…/widget.js" data-key="pb_pub_…">