Home RoadMap Blog Contact us Learn

Selenium Automation - Test cases for Registration form

 

Test Cases

Happy Path

  1. Test Case 1: Submit the form with all valid data
    • Steps:
      1. Enter username as "Nagaraju".
      2. Enter email as "nagaraju@example.com".
      3. Enter password as "password123".
      4. Enter age as "38".
      5. Click "Submit" button.
    • Expected Result: "Registration successful!" message should be displayed on top of the form

Error Cases

  1. Test Case 2: Username Too Short

    • Description: Username is shorter than the minimum length requirement.
    • Steps:
      1. Enter username as "jo".
      2. Enter email as "john.doe@example.com".
      3. Enter password as "password123".
      4. Enter age as "25".
      5. Click "Submit" button.
    • Expected Result: Error message "Username must be at least 3 characters long." is displayed below the username field.
  2. Test Case 3: Invalid Email Format

    • Description: Email field does not contain the "@" character.
    • Steps:
      1. Enter username as "john_doe".
      2. Enter email as "john.doeexample.com".
      3. Enter password as "password123".
      4. Enter age as "25".
      5. Click "Submit" button.
    • Expected Result: Error message "Please enter a valid email." is displayed below the email field.
  3. Test Case 4: Password Too Short

    • Description: Password is shorter than the minimum length requirement.
    • Steps:
      1. Enter username as "john_doe".
      2. Enter email as "john.doe@example.com".
      3. Enter password as "pass".
      4. Enter age as "25".
      5. Click "Submit" button.
    • Expected Result: Error message "Password must be at least 6 characters long." is displayed below the password field.
  4. Test Case 5: Age Out of Range

    • Description: Age is outside the valid range (less than 18 or greater than 100).
    • Steps:
      1. Enter username as "john_doe".
      2. Enter email as "john.doe@example.com".
      3. Enter password as "password123".
      4. Enter age as "17".
      5. Click "Submit" button.
    • Expected Result: Error message "Age must be between 18 and 100." is displayed below the age field.
  5. Test Case 6: Missing Mandatory Fields

    • Description: One or more mandatory fields are left empty.
    • Steps:
      1. Leave username empty.
      2. Enter email as "john.doe@example.com".
      3. Enter password as "password123".
      4. Enter age as "25".
      5. Click "Submit" button.
    • Expected Result: No specific error message for missing fields since the form has required attributes. It should prompt an empty error message or default browser validation if applicable.
  6. Test Case 7: Age Field with Non-Numeric Input

    • Description: The age field is filled with non-numeric input.
    • Steps:
      1. Enter username as "john_doe".
      2. Enter email as "john.doe@example.com".
      3. Enter password as "password123".
      4. Enter age as "abc".
      5. Click "Submit" button.
    • Expected Result: Error message indicating that the input is not a number should be displayed below the age field.

Recent Posts