How to Test Forgot Password on Web (Complete Guide)

The "Forgot Password" feature is a critical component of any web application. While often overlooked, its reliability directly impacts user experience and account security. A broken password reset flo

June 23, 2026 · 6 min read · How-To Guides

Mastering Forgot Password Flows: A Practical Guide for Web Application Testing

The "Forgot Password" feature is a critical component of any web application. While often overlooked, its reliability directly impacts user experience and account security. A broken password reset flow can lead to frustrated users, abandoned accounts, and potential security vulnerabilities. This guide details how to thoroughly test this essential functionality.

Why Forgot Password Testing is Crucial

Users forget passwords. It's an inevitability. A smooth, secure password reset process is paramount for retaining users and maintaining trust. Common failures include:

Comprehensive Test Cases for Forgot Password

A robust testing strategy covers happy paths, error conditions, and edge cases.

#### Happy Path Scenarios

  1. Successful Email Reset:
  1. Successful Username/Phone Reset (if applicable):

#### Error Scenarios

  1. Invalid Email Address:
  1. Empty Email Field:
  1. Invalid Reset Link (Expired/Used):
  1. Password Mismatch:
  1. Weak Password Policy Violation:
  1. Rate Limiting - Multiple Requests:

#### Edge Cases

  1. Special Characters in Email:
  1. Case Sensitivity:
  1. Simultaneous Reset Requests (Same User, Different Devices):

#### Accessibility Considerations

  1. Keyboard Navigation:
  1. Screen Reader Compatibility:
  1. Color Contrast:

Manual Testing Approach: Step-by-Step

  1. Access the Login Page: Navigate to your web application's login page.
  2. Locate "Forgot Password": Click the "Forgot Password" or "Reset Password" link.
  3. Enter Registered Email: Type a valid, registered email address into the provided field.
  4. Submit Request: Click the "Submit" or "Send Reset Link" button.
  5. Check Inbox: Open the inbox for the entered email address.
  6. Verify Email Content: Confirm the email has arrived promptly, contains clear instructions, and a functional reset link.
  7. Click Reset Link: Click the provided link.
  8. Verify Reset Page: Ensure you are directed to the correct password reset page, not the login page.
  9. Enter New Passwords: Input a new password and confirm it. Pay attention to password policy requirements displayed on the page.
  10. Submit New Password: Click the "Reset Password" or "Save" button.
  11. Verify Success Message: Look for a confirmation that the password has been successfully updated.
  12. Test New Login: Attempt to log in using the newly created password.
  13. Repeat for Error Cases: Systematically go through the error scenarios outlined above, documenting each observed behavior and error message.
  14. Accessibility Check: Use keyboard navigation and a screen reader to test the entire flow.

Automated Testing Approach for Web

Automated testing is essential for regression and efficiency. For web applications, frameworks like Playwright and Selenium WebDriver are industry standards.

Playwright is a strong choice for modern web testing due to its speed, reliability, and robust API. It offers cross-browser support and auto-waits.

Example using Playwright (Node.js):


const { test, expect } = require('@playwright/test');

test('Forgot password flow', async ({ page }) => {
  // Navigate to the login page
  await page.goto('YOUR_APP_LOGIN_URL');

  // Click the forgot password link
  await page.click('text="Forgot Password?"');

  // Enter a registered email
  await page.fill('input[name="email"]', 'testuser@example.com');

  // Submit the request
  await page.click('button[type="submit"]');

  // --- This part is tricky for automation: Email reception ---
  // For email verification, you'd typically integrate with an email testing service
  // like Mailtrap, Ethereal, or use IMAP/POP3 if your test environment allows.
  // Assuming you have a way to get the reset link (e.g., from an email testing service API):
  const resetLink = await getResetLinkFromEmailService('testuser@example.com');

  // Navigate to the reset link
  await page.goto(resetLink);

  // Enter a new password
  await page.fill('input[name="newPassword"]', 'NewStrongPassword123!');
  await page.fill('input[name="confirmPassword"]', 'NewStrongPassword123!');

  // Submit the new password
  await page.click('button[type="submit"]');

  // Verify success message (adjust selector as needed)
  await expect(page.locator('text="Password reset successfully."')).toBeVisible();

  // Verify login with new password
  await page.fill('input[name="email"]', 'testuser@example.com'); // Or username
  await page.fill('input[name="password"]', 'NewStrongPassword123!');
  await page.click('button[type="submit"]');

  // Verify successful login (e.g., check for a dashboard element)
  await expect(page.locator('text="Welcome, Test User!"')).toBeVisible();
});

// Placeholder function for getting the reset link from an email service
async function getResetLinkFromEmailService(emailAddress) {
  // Replace with actual integration logic for your email testing service
  console.log(`Simulating fetching reset link for ${emailAddress}...`);
  // In a real scenario, you'd query your email testing service API.
  // For demonstration, returning a dummy link:
  return 'https://your-app.com/reset-password?token=dummy_valid_token_12345';
}

Key considerations for automation:

How SUSA Tests Forgot Password Autonomously

SUSA's autonomous QA platform tackles forgot password flows by simulating real user interactions across multiple user personas. This dynamic testing approach uncovers issues that traditional scripted tests might miss.

SUSA identifies:

Test Your App Autonomously

Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts.

Try SUSA Free