QA interview guide

How would you test a login page?

A login page looks simple, but interviewers use it to see whether you think beyond valid and invalid credentials. A strong answer covers user flows, account states, abuse prevention, session behavior, backend failures, and accessible UX.

Write your own answer and compare it with senior QA coverage.

What interviewers expect

What interviewers expect

Interviewers expect you to start with successful sign-in, then expand into invalid credentials, locked or unverified accounts, rate limiting, secure errors, redirects, remember-me behavior, session cookies, mobile layout, and keyboard or screen reader support.

Checklist

Checklist

Use these practical prompts to build a complete answer. Strong interview responses usually include functional behavior, negative cases, security, backend/data risks, UX, accessibility, and reliability.

Functional checks

  • Valid email and password sign the user in.
  • Successful login redirects to the dashboard or originally requested page.
  • Remember me, forgot password, logout, and session timeout follow requirements.
  • MFA or SSO-only users are routed to the correct next step if supported.

Negative and account state cases

  • Invalid password, unknown email, empty fields, malformed email, and whitespace inputs show safe errors.
  • Locked, disabled, suspended, deleted, and unverified accounts behave correctly.
  • Repeated submits and slow responses do not create duplicate requests or confusing UI.

Security and backend risks

  • Brute-force protection, throttling, CAPTCHA, or lockout rules work.
  • Errors do not reveal whether the email exists.
  • Passwords and tokens are not exposed in URLs, logs, analytics, page source, or client storage.
  • API status codes, backend failures, cookie flags, and safe redirects are verified.

UX, accessibility, and reliability

  • Labels, focus states, keyboard navigation, screen reader errors, and password visibility control work.
  • Loading, error, and recovery states are clear on desktop and mobile.
  • Slow network and timeout behavior are understandable and recoverable.

Complete interview coverage checklist

Aim to mention 20-40 concrete checks. This expanded list helps you turn a short answer into a structured senior-style response.

Valid email and password sign the user in.
Successful login redirects to the dashboard or originally requested page.
Remember me, forgot password, logout, and session timeout follow requirements.
MFA or SSO-only users are routed to the correct next step if supported.
Invalid password, unknown email, empty fields, malformed email, and whitespace inputs show safe errors.
Locked, disabled, suspended, deleted, and unverified accounts behave correctly.
Repeated submits and slow responses do not create duplicate requests or confusing UI.
Brute-force protection, throttling, CAPTCHA, or lockout rules work.
Errors do not reveal whether the email exists.
Passwords and tokens are not exposed in URLs, logs, analytics, page source, or client storage.
API status codes, backend failures, cookie flags, and safe redirects are verified.
Labels, focus states, keyboard navigation, screen reader errors, and password visibility control work.
Loading, error, and recovery states are clear on desktop and mobile.
Slow network and timeout behavior are understandable and recoverable.
Structure your answer: Start with the happy path: valid credentials, expected redirect, and successful session creation.
Structure your answer: Add negative inputs and account states: wrong password, unknown email, empty fields, locked or unverified users.
Structure your answer: Add security: brute-force protection, generic errors, password masking, secure cookies, and safe redirects.
Structure your answer: Close with UX, accessibility, mobile layout, API failures, and performance under slow responses.
Do not miss: Locked, disabled, unverified, and MFA-required account states.
Do not miss: Brute-force protection and account enumeration.
Do not miss: Session cookies, logout, redirect safety, and browser-back behavior.
Do not miss: Accessibility and mobile layout.

Ready to practice?

Practice this scenario interactively

Write your own answer and compare it with senior QA coverage.

Practice this scenario

Answer structure

Strong answer structure

  1. Start with the happy path: valid credentials, expected redirect, and successful session creation.
  2. Add negative inputs and account states: wrong password, unknown email, empty fields, locked or unverified users.
  3. Add security: brute-force protection, generic errors, password masking, secure cookies, and safe redirects.
  4. Close with UX, accessibility, mobile layout, API failures, and performance under slow responses.

Common missed areas

Common missed risks

Locked, disabled, unverified, and MFA-required account states.
Brute-force protection and account enumeration.
Session cookies, logout, redirect safety, and browser-back behavior.
Accessibility and mobile layout.

Answer template

Use this interview answer template

I would start with successful login and redirects, then cover invalid credentials, empty fields, locked or unverified accounts, brute-force protection, generic errors, session cookies, remember me, logout, backend failures, UX, accessibility, and performance under slow responses.

Use it as a structure, then replace the examples with specific checks for the feature you are discussing.

Common weak answer

“I would test valid and invalid cases.”

This is too generic because it does not show risk thinking. A stronger answer names the happy path, negative cases, security risks, backend/data behavior, UX/accessibility, and reliability concerns that matter for this exact scenario.

Examples

Weak answer vs stronger answer

Weak answer
I would test valid login and invalid password.

This covers the obvious happy path and one negative case, but misses account states, sessions, abuse prevention, backend behavior, UX, accessibility, and mobile behavior.

Stronger answer
I would test valid login, invalid password, unknown email, empty fields, locked and unverified accounts, remember me, forgot password, logout, session timeout, safe redirect after login, brute-force protection, generic error messages, password masking, secure cookies, direct URL access, backend errors, slow network, keyboard navigation, labels, focus states, screen reader errors, and mobile layout.

FAQ

Frequently asked questions

What should I mention first when answering "How would you test a login page?"

Start with the happy path: valid credentials, expected redirect, and successful session creation.

Should I include negative and edge cases?

Invalid password, unknown email, empty fields, malformed email, and whitespace inputs show safe errors. Locked, disabled, suspended, deleted, and unverified accounts behave correctly.

Should I include security, API, or backend risks?

Brute-force protection, throttling, CAPTCHA, or lockout rules work. Errors do not reveal whether the email exists.

What are common missed risks?

Locked, disabled, unverified, and MFA-required account states. Brute-force protection and account enumeration. Session cookies, logout, redirect safety, and browser-back behavior. Accessibility and mobile layout.

How can I practice this answer?

Use the interactive how would you test a login page? challenge to write your own answer, get checklist-based feedback, and compare your coverage with stronger QA thinking.

Practice

Practice this scenario interactively

Write your own answer and compare it with senior QA coverage.

Practice this scenario