Wednesday, July 9, 2025

Top 15 Test Cases for Login Page – Manual & Automation Examples (With Bug Scenarios)

Top 15 Test Cases for Login Page – Manual & Automation Examples (With Bug Scenarios)

Testing a login page is one of the most important tasks in software testing. Whether you’re preparing for a QA interview or writing real-time test cases for your web or mobile application, a login module provides many critical validations. In this post, you’ll learn manual test cases, common bugs, and Selenium automation examples for login functionality.

🔍 Why Login Page Testing Is Important?

  • The first point of user interaction with the app
  • Security entry point – needs proper validation
  • The most common area where users face errors

📝 Top 15 Manual Test Cases for Login Page

Test Case ID Scenario Test Steps Expected Result
TC001 Valid username and password Enter valid credentials and click Login The user should be redirected to the dashboard
TC002 Invalid password Enter a valid username and the wrong password The error message should appear
TC003 Blank username and password Leave both fields blank and click Login Validation messages should be displayed
TC004 Blank username only Leave the username blank, enter the password, and click Login The username required message should appear
TC005 Blank password only Enter username, leave the password blank, click Login Password required message should appear
TC006 SQL injection attempt Enter "admin' OR 1=1--" as the username Input should be rejected and sanitized
TC007 Special characters in the username Enter special characters like '@#$%' Error or input validation message should appear
TC008 The password field is masked Check if the password is displayed as dots or asterisks Characters should be hidden
TC009 Remember Me checkbox Select the checkbox and log in The user should stay logged in on the next visit
TC010 Forgot Password link Click the link and validate the navigation The user should go to the reset password screen
TC011 Case sensitivity Enter uppercase instead of lowercase username The system should handle case sensitivity properly
TC012 Browser Back button after login Log in successfully and press the browser back button The user should not return to the login page or see cached content
TC013 Multiple failed login attempts Try logging in with the wrong password 5 times Account lock or CAPTCHA should appear
TC014 Login session timeout Login and remain idle The session should expire after the defined timeout
TC015 Mobile responsiveness Open the login page on mobile devices The login form should render correctly on smaller screens

🐞 Common Bug Scenarios on Login Page

  • Login accepts invalid email or empty credentials
  • The password is visible even after clicking the "eye" toggle
  • No validation messages for blank fields
  • Incorrect redirect after login
  • The session has not expired after logging out

🤖 Selenium Automation Example – Valid Login Test


@Test
public void validLoginTest() {
    WebDriver driver = new ChromeDriver();
    driver.get("https://example.com/login");
    
    driver.findElement(By.id("username")).sendKeys("testuser");
    driver.findElement(By.id("password")).sendKeys("testpass");
    driver.findElement(By.id("loginBtn")).click();
    
    String expectedTitle = "Dashboard";
    String actualTitle = driver.getTitle();
    Assert.assertEquals(actualTitle, expectedTitle);

    driver.quit();
}

This Selenium test script verifies a successful login using valid credentials. You can also write negative test cases using invalid passwords and assert error messages.

👋 Hi, I'm Suriya — QA Engineer with 4+ years of experience in manual, API & automation testing.

📬 Contact Me | LinkedIn | GitHub

📌 Follow for: Real-Time Test Cases, Bug Reports, Selenium Frameworks.

No comments:

Post a Comment