140+ Login Page Test Cases (With Free Template and Examples)

test cases for login page

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.

Key takeaways
The 30-second version of this article
A complete login test suite covers positive and negative inputs, performance, security, authentication methods (MFA, SSO, passkeys), sessions and lockout, accessibility, and mobile.
Each sign-in method needs its own cases: expired and reused MFA codes, identity provider outages for SSO, and a fallback for browsers without passkey support.
Session tests matter as much as credential tests: logout must invalidate the token on the server, and a new session ID must be issued after login.
Error and lockout messages should never reveal whether a username exists, to prevent user enumeration.
Login flows run in almost every regression cycle, so they are a strong candidate for automation once the cases are stable.
100 test cases for login page your team need

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:

  1. Valid username and password successfully log the user in.
  2. Login using minimum allowed username and password length.
  3. Login using alphanumeric credentials.
  4. Successful login with “Remember Me” selected.
  5. Login with mixed-case username.
  6. Login using a valid email as the username.
  7. Login using a valid phone number as the username.
  8. Successful login with multi-factor authentication (MFA).
  9. Login with special characters in the username (e.g., @, #, $).
  10. Login using social media accounts (if supported).
  11. Login using biometric authentication.
  12. Login after password reset using the new password.
  13. Login after completing account recovery.
  14. Login with different localization/language settings.
  15. 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:

  1. Incorrect password for a valid username.
  2. Incorrect username for a valid password.
  3. Empty username field.
  4. Empty password field.
  5. Username not found in the system.
  6. Password not meeting strength requirements.
  7. Excessively long usernames or passwords.
  8. Incorrect case used in username.
  9. Expired or deactivated account.
  10. Suspended account.
  11. Multiple failed attempts triggering lockout.
  12. Login after session timeout.
  13. Incorrect MFA code.
  14. Invalid characters or script injection in fields.
  15. 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:

  1. Measure average login page load time.
  2. Load testing for max concurrent user logins.
  3. Measure response time during peak hours.
  4. Monitor server resource usage (CPU, RAM, bandwidth) during logins.
  5. Test performance across browsers and devices.
  6. Test performance on slow network connections.
  7. Measure recovery time after failed login attempts.
  8. Test performance when database is under heavy load.
  9. Test during simulated DDoS attacks.
  10. Test handling of high volumes of simultaneous login attempts.
  11. Measure impact of rate limiting.
  12. Test with different authentication methods (password, MFA).
  13. Test with large numbers of inactive accounts.
  14. Measure CAPTCHA impact on performance.
  15. 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:

  1. Test for SQL injection via username and password fields.
  2. Test for XSS using script injections.
  3. Verify HTTPS is enforced.
  4. Test for session fixation vulnerabilities.
  5. Verify passwords are hashed and salted.
  6. Test for clickjacking attacks.
  7. Check brute-force protection (lockout, rate limiting).
  8. Verify login page does not reveal username validity.
  9. Test for user enumeration attempts.
  10. Verify that session tokens and cookies are securely generated and stored.
  11. Test the security of password reset and account recovery processes.
  12. Evaluate the login page’s resistance to DDoS attacks.
  13. Test for insecure password policies (e.g., weak password requirements).
  14. Verify that error messages do not reveal unnecessary information (e.g., “Invalid username or password” instead of specifying which one failed).
  15. 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)

  1. Valid one-time code from an authenticator app completes login.
  2. Expired one-time code is rejected with a clear message.
  3. A code that was already used cannot be reused.
  4. SMS or email code arrives within the expected time, and "Resend code" works and invalidates the old code.
  5. Backup or recovery codes log the user in and each works only once.
  6. "Remember this device" skips MFA on the same device and still asks on a new device.

Single sign-on (SSO)

  1. "Sign in with Google, Microsoft, or Okta" redirects to the identity provider and back to the right page.
  2. A user who cancels at the identity provider returns to the login page with a clear message.
  3. Login fails gracefully when the identity provider is down or times out.
  4. A first-time SSO user is created or linked to an existing account with the same email, as the spec requires.
  5. A user removed from the identity provider can no longer log in.
  6. Logging out of the app (and the identity provider, if single logout is supported) ends the session in both places.

Passkeys (WebAuthn)

  1. A user can create a passkey from account settings and log in with it.
  2. Login with a passkey works through the device's biometric or PIN prompt.
  3. Cancelling the passkey prompt returns the user to the login page without an error loop.
  4. Login from a second device works through the cross-device flow (for example, scanning a QR code with a phone).
  5. A deleted passkey can no longer be used to log in.
  6. 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.

  1. Session expires after the configured idle timeout and the user is asked to log in again.
  2. Logout invalidates the session token on the server, not only in the browser.
  3. After logout, the browser Back button does not show authenticated pages.
  4. "Remember me" keeps the user logged in for the configured period and then expires.
  5. Changing the password ends other active sessions, if the spec requires it.
  6. Concurrent logins from two devices behave as the spec says (both allowed, or the older session ends).
  7. A new session ID is issued after login, so a pre-login session ID cannot be reused.
  8. The account locks after the configured number of failed attempts.
  9. The lockout message does not reveal whether the username exists.
  10. A locked account unlocks after the configured time or through the reset flow.
  11. Rate limiting slows repeated attempts from one IP address across many usernames.
  12. 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:

  1. 7 characters is rejected.
  2. 8 characters is accepted.
  3. 64 characters is accepted.
  4. 65 characters is rejected, through the API as well as the form.
  5. Username at its maximum length is accepted, and one character over is rejected.
  6. Leading and trailing spaces in the username are handled as the spec says (trimmed or rejected).

8. Accessibility test cases for the login page

  1. Every field has a visible label that screen readers announce.
  2. The whole form works with the keyboard alone, in a logical tab order.
  3. Error messages are announced by screen readers and tied to the field they describe.
  4. Password managers can autofill the fields (correct autocomplete attributes such as username and current-password).
  5. A show or hide password toggle works and is reachable by keyboard.
  6. Text and buttons meet color contrast requirements.
  7. CAPTCHA offers an accessible alternative, such as an audio challenge.
  8. 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:

  1. Enter a valid username (e.g., user).
  2. 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:

  1. Verify that the Gmail login page is accessible from the Gmail homepage.
  2. Test login with valid Gmail account credentials.
  3. Test login with an incorrect Gmail account password.
  4. Test login with an incorrect Gmail account username/email.
  5. Test login with a Gmail account that has two-factor authentication (2FA) enabled.
  6. Verify that the “Stay signed in” option works as expected.
  7. Test the “Forgot password?” link for password recovery functionality.
  8. Test login using Google’s “Sign in with Google” option (if applicable).
  9. Verify that the Gmail login page supports multiple languages.
  10. Test responsiveness across devices (desktop, mobile, tablet).
  11. Check for security features such as CAPTCHA or anti-bot protection.
  12. Test Gmail login performance during peak usage times.
  13. Verify secure session management after login.
  14. Test the login page’s behavior when JavaScript is disabled.
  15. 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

test cases for mobile Login page

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:

  1. Test the login page layout across different mobile devices (phones, tablets).
  2. Verify support for both portrait and landscape orientations.
  3. Test login with valid credentials.
  4. Test login with invalid credentials.
  5. Test login with special characters in username and password fields.
  6. Test the “Forgot password?” functionality.
  7. Verify responsiveness across various mobile screen sizes.
  8. Test the “Remember Me” option.
  9. Test the “Stay signed in” option.
  10. Test login with multi-factor authentication (MFA).
  11. Verify integration with device biometrics (fingerprint, face ID).
  12. Test performance under different network types (3G, 4G, Wi-Fi).
  13. Test compatibility across OS versions (Android, iOS).
  14. Verify login behavior when the device is in airplane mode.
  15. 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 test cases for 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 in

Free 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.

PDF | Doc | Excel

How to automate login page testing with Katalon True

undefined-Nov-14-2025-08-23-18-2431-AM

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

Henrik (Minh Huy) Dao

Minh Huy Dao (Henrik) is a Senior Quality Engineer at Katalon, where he has worked since 2023. He has nearly 10 years of experience in QA and test automation, including roles at TMA Solutions, Axon Active and Doctor Anywhere. His work spans automation with Java, JavaScript and WebdriverIO, as well as CI/CD with Jenkins and leading Scrum teams.

Connect on LinkedIn →
Get started

Test everything. Ship with confidence.

From generating test cases to spotting failures, Katalon's AI works across your entire pipeline, automatically.

Live webinar

The Next Evolution of Manual Testing: Introducing Katalon AI Test Runner

Learn how to grow your QA team's capacity in the age of AI, then watch Katalon AI Test Runner turn manual test cases into automated runs, live.

2:00 to 3:00 PM IST
Almas AhmedSenior Account Manager
Sumit WankhedeSolutions Engineer Manager
Register now