140+ login page test cases grouped by category: positive, negative, performance, security, MFA, SSO, passkeys, sessions and lockout, accessibility, mobile, and BDD. Includes a free test case template in Excel, Doc, and PDF.

Login page test cases check that the right users get in, the wrong users stay out, and the page holds up under load and attack. A complete set covers positive and negative inputs, performance, security, authentication flows such as MFA, SSO, and passkeys, session handling, accessibility, and mobile. This guide lists 140+ login page test cases you can use as references in software testing and web testing.
The test cases are grouped by category so you can copy the sections that apply to your app. Free template: download the login test case template in Excel, Doc, or PDF to document them.
Read More: A Complete Web Testing Checklist
1. Positive login page test cases
Positive test cases verify that the Login page behaves correctly with valid inputs. Common scenarios include:
- Valid username and password successfully log the user in.
- Login using minimum allowed username and password length.
- Login using alphanumeric credentials.
- Successful login with “Remember Me” selected.
- Login with mixed-case username.
- Login using a valid email as the username.
- Login using a valid phone number as the username.
- Successful login with multi-factor authentication (MFA).
- Login with special characters in the username (e.g., @, #, $).
- Login using social media accounts (if supported).
- Login using biometric authentication.
- Login after password reset using the new password.
- Login after completing account recovery.
- Login with different localization/language settings.
- Login across different browsers (Chrome, Firefox, Edge, etc.).
2. Negative login page test cases
Negative test cases check how the Login page handles invalid or unexpected input. Common scenarios include:
- Incorrect password for a valid username.
- Incorrect username for a valid password.
- Empty username field.
- Empty password field.
- Username not found in the system.
- Password not meeting strength requirements.
- Excessively long usernames or passwords.
- Incorrect case used in username.
- Expired or deactivated account.
- Suspended account.
- Multiple failed attempts triggering lockout.
- Login after session timeout.
- Incorrect MFA code.
- Invalid characters or script injection in fields.
- Failed CAPTCHA validation.
3. Performance test cases for the login page
Performance testing checks whether the Login page can handle different levels of traffic. This matters especially for high-traffic sites like ecommerce, financial services, public services, or institutions with seasonal spikes (e.g., school enrollment).
Key performance test cases include:
- Measure average login page load time.
- Load testing for max concurrent user logins.
- Measure response time during peak hours.
- Monitor server resource usage (CPU, RAM, bandwidth) during logins.
- Test performance across browsers and devices.
- Test performance on slow network connections.
- Measure recovery time after failed login attempts.
- Test performance when database is under heavy load.
- Test during simulated DDoS attacks.
- Test handling of high volumes of simultaneous login attempts.
- Measure impact of rate limiting.
- Test with different authentication methods (password, MFA).
- Test with large numbers of inactive accounts.
- Measure CAPTCHA impact on performance.
- Measure MFA code delivery time.
Read More: Performance Testing vs Load Testing
4. Security test cases for the login page
The Login page is the first security barrier for most systems, controlling access and protecting user data. Security testing verifies that vulnerabilities are closed, either through in-house checks or authorized penetration testing.
Essential security test cases include:
- Test for SQL injection via username and password fields.
- Test for XSS using script injections.
- Verify HTTPS is enforced.
- Test for session fixation vulnerabilities.
- Verify passwords are hashed and salted.
- Test for clickjacking attacks.
- Check brute-force protection (lockout, rate limiting).
- Verify login page does not reveal username validity.
- Test for user enumeration attempts.
- Verify that session tokens and cookies are securely generated and stored.
- Test the security of password reset and account recovery processes.
- Evaluate the login page’s resistance to DDoS attacks.
- Test for insecure password policies (e.g., weak password requirements).
- Verify that error messages do not reveal unnecessary information (e.g., “Invalid username or password” instead of specifying which one failed).
- Evaluate the system’s compliance with relevant security standards such as OWASP Top Ten.
5. MFA, SSO, and passkey test cases
Most login pages no longer stop at a username and password. If your app supports any of these methods, each one needs its own test cases.
Multi-factor authentication (MFA)
- Valid one-time code from an authenticator app completes login.
- Expired one-time code is rejected with a clear message.
- A code that was already used cannot be reused.
- SMS or email code arrives within the expected time, and "Resend code" works and invalidates the old code.
- Backup or recovery codes log the user in and each works only once.
- "Remember this device" skips MFA on the same device and still asks on a new device.
Single sign-on (SSO)
- "Sign in with Google, Microsoft, or Okta" redirects to the identity provider and back to the right page.
- A user who cancels at the identity provider returns to the login page with a clear message.
- Login fails gracefully when the identity provider is down or times out.
- A first-time SSO user is created or linked to an existing account with the same email, as the spec requires.
- A user removed from the identity provider can no longer log in.
- Logging out of the app (and the identity provider, if single logout is supported) ends the session in both places.
Passkeys (WebAuthn)
- A user can create a passkey from account settings and log in with it.
- Login with a passkey works through the device's biometric or PIN prompt.
- Cancelling the passkey prompt returns the user to the login page without an error loop.
- Login from a second device works through the cross-device flow (for example, scanning a QR code with a phone).
- A deleted passkey can no longer be used to log in.
- Users on a browser without passkey support can still log in another way.
6. Session and lockout test cases
These checks cover what happens after the credentials are accepted, and what happens when they keep failing.
- Session expires after the configured idle timeout and the user is asked to log in again.
- Logout invalidates the session token on the server, not only in the browser.
- After logout, the browser Back button does not show authenticated pages.
- "Remember me" keeps the user logged in for the configured period and then expires.
- Changing the password ends other active sessions, if the spec requires it.
- Concurrent logins from two devices behave as the spec says (both allowed, or the older session ends).
- A new session ID is issued after login, so a pre-login session ID cannot be reused.
- The account locks after the configured number of failed attempts.
- The lockout message does not reveal whether the username exists.
- A locked account unlocks after the configured time or through the reset flow.
- Rate limiting slows repeated attempts from one IP address across many usernames.
- Successful login resets the failed attempt counter.
7. Boundary test cases for login fields
Use boundary value analysis on the length rules. For a password that must be 8 to 64 characters:
- 7 characters is rejected.
- 8 characters is accepted.
- 64 characters is accepted.
- 65 characters is rejected, through the API as well as the form.
- Username at its maximum length is accepted, and one character over is rejected.
- Leading and trailing spaces in the username are handled as the spec says (trimmed or rejected).
8. Accessibility test cases for the login page
- Every field has a visible label that screen readers announce.
- The whole form works with the keyboard alone, in a logical tab order.
- Error messages are announced by screen readers and tied to the field they describe.
- Password managers can autofill the fields (correct
autocompleteattributes such asusernameandcurrent-password). - A show or hide password toggle works and is reachable by keyboard.
- Text and buttons meet color contrast requirements.
- CAPTCHA offers an accessible alternative, such as an audio challenge.
- The page stays usable at 200% zoom.
9. How to test SQL injection on a login page
SQL Injection occurs when malicious SQL code is inserted into a web application’s input fields to manipulate or damage the database. It remains one of the most common web hacking techniques, even decades after its discovery.
Suppose you have a login page at https://example.com/login. If the backend doesn’t properly sanitize user input, the system becomes an easy target for SQL Injection. Here’s a simple example of vulnerable Python code:
username = get_user_input()
password = get_user_input()
# Vulnerable SQL query
query = "SELECT * FROM users WHERE username='" + username + "' AND password='" + password + "'"
print(query)This approach has two critical issues:
- The username and password fields are used without any validation or sanitization.
- The SQL query is assembled by directly concatenating user-supplied data.
Because of this, an attacker can bypass authentication with just two inputs:
- Enter a valid username (e.g., user).
- Enter the following payload in the password field:
# Attacker inputs:
username: user
password: ' OR '1'='1
# Resulting SQL query:
SELECT * FROM users
WHERE username='user'
AND password='' OR '1'='1';The resulting query executed by the database becomes:
SELECT *
FROM users
WHERE username='user'
AND password=''
OR '1'='1';Because '1'='1' is always true, the query returns a user without checking the password. To test for this, enter payloads like the one above in both fields and confirm the login fails with a generic error. The fix on the development side is a parameterized query, which treats input as data rather than SQL:
cursor.execute(
"SELECT * FROM users WHERE username = %s AND password_hash = %s",
(username, hash_password(password)),
)10. Gmail login page test cases
Test cases for the Gmail Login page are similar to any other Login page:
- Verify that the Gmail login page is accessible from the Gmail homepage.
- Test login with valid Gmail account credentials.
- Test login with an incorrect Gmail account password.
- Test login with an incorrect Gmail account username/email.
- Test login with a Gmail account that has two-factor authentication (2FA) enabled.
- Verify that the “Stay signed in” option works as expected.
- Test the “Forgot password?” link for password recovery functionality.
- Test login using Google’s “Sign in with Google” option (if applicable).
- Verify that the Gmail login page supports multiple languages.
- Test responsiveness across devices (desktop, mobile, tablet).
- Check for security features such as CAPTCHA or anti-bot protection.
- Test Gmail login performance during peak usage times.
- Verify secure session management after login.
- Test the login page’s behavior when JavaScript is disabled.
- Verify the behavior of the “Create account” link for new Gmail registrations.
Read More: 100 Test Cases For Registration Page
11. Login page test cases for mobile apps

Here we enter the domain of mobile testing, which comes with its own unique challenges. Devices vary widely in model, resolution, and mobile-specific behavior. Here are several login page test cases tailored for mobile apps:
- Test the login page layout across different mobile devices (phones, tablets).
- Verify support for both portrait and landscape orientations.
- Test login with valid credentials.
- Test login with invalid credentials.
- Test login with special characters in username and password fields.
- Test the “Forgot password?” functionality.
- Verify responsiveness across various mobile screen sizes.
- Test the “Remember Me” option.
- Test the “Stay signed in” option.
- Test login with multi-factor authentication (MFA).
- Verify integration with device biometrics (fingerprint, face ID).
- Test performance under different network types (3G, 4G, Wi-Fi).
- Test compatibility across OS versions (Android, iOS).
- Verify login behavior when the device is in airplane mode.
- Test login behavior when the device has low or limited storage.
Read More: Top API Test Cases You Should Test
12. BDD test cases for the login page

BDD testing writes test cases in plain language, usually Gherkin, so non-technical team members can read them. A typical BDD test uses three statements:
- Given sets the starting context or initial state.
- When describes the action or trigger.
- Then defines the expected outcome.
Here are 12 login page test cases written in Gherkin:
Feature: Login
Scenario: Successful login
Given a registered user with a valid username and password
When the user logs in
Then the user is taken to the dashboard
Scenario: Invalid password
Given a valid username and an incorrect password
When the user logs in
Then the error "Invalid username or password" is shown
Scenario: Empty username field
Given the username field is empty
When the user logs in
Then the message "Username is required" is shown
Scenario: Empty password field
Given the password field is empty
When the user logs in
Then the message "Password is required" is shown
Scenario: Username with special characters
Given a valid username that contains special characters
When the user logs in
Then the user is logged in
Scenario: Locked account
Given an account locked after too many failed attempts
When the user logs in with the correct password
Then an account-locked message is shown
Scenario: Remember me
Given valid credentials with "Remember me" selected
When the user logs in and later reopens the browser
Then the user is still logged in
Scenario: Multi-factor authentication
Given valid credentials for an account with MFA enabled
When the user logs in
Then the user is asked for an authentication code
Scenario: Expired MFA code
Given the user is on the MFA step
When the user enters an expired code
Then the code is rejected and the user can request a new one
Scenario: Password reset
Given a user who requested a password reset
When the user follows the reset link and sets a new password
Then the user can log in with the new password only
Scenario: Account recovery
Given a user who started account recovery
When the user completes the recovery steps
Then the user regains access to the account
Scenario: Login with SSO
Given a user with an account at the identity provider
When the user chooses "Sign in with SSO" and authenticates
Then the user returns to the app logged inFree test case template to download
To write effective test cases, it helps to start with a test case template. We've prepared PDF, Doc, and Excel versions for easy download. Choose your preferred format below and begin documenting your test cases instantly.
How to automate login page testing with Katalon True

Login page testing isn’t overly complex, but it is highly repetitive. Because it’s a critical user entry point, frequent regression testing is essential. While automation is a smart strategy, building scripts from scratch and updating them after every UI change often becomes inefficient.
The same is true of the payment step that typically follows login: critical, repetitive, and expensive when it fails in production. Our payment gateway test cases guide covers 50+ scenarios for the checkout layer, including session handling between authentication and payment completion.
With Katalon True, you can create, manage, run, maintain, and report on your tests in one place.
For example, you can use the Katalon AI Assistant (Kai) in Katalon Studio to generate a test script from manual test steps. In the video below, starting at 1:55, the assistant scans the application under test, creates test objects, and generates automation scripts for invalid login scenarios.
In Katalon True, AI agents can also draft test cases from requirements in your ALM tool, turn them into automation scripts, schedule runs, and summarize results. You can watch the end-to-end demo in this free course.
Ready to go beyond the checklist? Understanding login test cases is step one. Applying them inside a real automation platform is step two. Katalon Academy has free hands-on courses for web and functional testing. No prior experience needed.
Frequently asked questions
Cover positive cases (valid credentials), negative cases (wrong or empty inputs), performance, security (SQL injection, XSS, brute force), authentication methods such as MFA, SSO, and passkeys, session and lockout behavior, accessibility, and mobile-specific checks.
Negative test cases check how the page handles invalid input: a wrong password, an unknown username, empty fields, overly long values, an expired or locked account, an incorrect MFA code, and script or SQL injection attempts. The page should reject each one with a clear, generic error.
For MFA, test valid, expired, and reused codes, resend behavior, backup codes, and "remember this device." For SSO, test the redirect round trip, a cancelled sign-in, an identity provider outage, account linking, and logout in both the app and the identity provider.
Enter payloads such as ' OR '1'='1 in the username and password fields and confirm login fails with a generic error. A vulnerable app builds its SQL query by joining strings; the fix is a parameterized query.
Automate the stable, repeated checks first: valid and invalid credentials, empty fields, lockout, session expiry, and logout. Keep exploratory checks, visual review, and new authentication flows manual until they settle.
Yes. This guide includes a free test case template in Excel, Doc, and PDF that you can use to document your login page test cases. See also our test case template examples.

Test everything. Ship with confidence.
From generating test cases to spotting failures, Katalon's AI works across your entire pipeline, automatically.





