You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This project automates the process of filling and submitting web-based registration forms using Selenium WebDriver and TestNG in Java.
Many websites require users to fill out registration, contact, or feedback forms — a repetitive and time-consuming task.
Through this project, the process is automated, ensuring faster testing and validation of form submissions, input validations, and captcha verification.
The module includes:
Automated form filling with multiple input types (text fields, radio buttons, dropdowns, checkboxes)
Captcha handling and verification
Validation testing for mandatory fields and incorrect inputs
Integration of automated test execution using TestNG
Project Title
Automated Form Filling Using Selenium and TestNG
Module
Registration Form with Captcha
Tester
Saurabh Kisan Butale
Test Environment
Tool
Selenium WebDriver with TestNG
Language
Java
Browser
Google Chrome (Version: 141.0.7390.77)
OS
Windows 11
Execution Mode
Local HTML File Automation
Test Cases
Test Case 1 – Form Submission with Valid Data
Parameter
Details
Test Case ID
TC_01
Objective
To verify that the registration form is submitted successfully when all mandatory fields are entered correctly, and the captcha input matches the generated captcha.
Preconditions
The registration form page is loaded successfully in the browser. All form fields and elements are visible and interactive.
Test Steps
1. Launch the browser and open the registration form HTML file.
2. Enter valid data in all fields (Full Name, Email, Password).
3. Select “Male” as gender.
4. Choose “India” from the country dropdown.
5. Check the Terms & Conditions checkbox.
6. Read and enter the correct captcha displayed.
7. Click the Submit button.
Expected Result
A confirmation alert message should appear indicating “Registration Successful”.
Actual Result
The alert message was displayed successfully with the text “Registration Successful”.
Test Status
Passed
Observation
The form validation worked as expected, and the submission process triggered an alert. Captcha verification correctly allowed submission when entered accurately.
Remarks
System handled valid data correctly and displayed the success message without delay.
Test Case 2 – Form Submission with Invalid Captcha
Parameter
Details
Test Case ID
TC_02
Objective
To verify that the form displays an appropriate error message when the entered captcha does not match the generated captcha.
Preconditions
The registration form page is loaded successfully in the browser.
Test Steps
1. Refresh the registration form.
2. Enter valid data in all mandatory fields.
3. Select “Male” and country “India”.
4. Check the Terms & Conditions checkbox.
5. Enter an incorrect captcha (e.g., “wrongCaptcha”).
6. Click the Submit button.
Expected Result
An error message should appear indicating “Captcha is incorrect. Try again.” and form submission should be blocked.
Actual Result
The system displayed the validation message “Captcha is incorrect. Try again.”, and no alert was shown.
Test Status
Passed
Observation
Captcha validation logic performed correctly. Incorrect captcha prevented form submission and displayed the expected error message.
Remarks
The validation mechanism is functioning as intended, effectively preventing incorrect form submissions.
Test Case 3 – Form Submission Without Accepting Terms & Conditions
Parameter
Details
Test Case ID
TC_03
Objective
To verify that the form blocks submission and displays an error message if the user does not accept the Terms & Conditions checkbox.
Preconditions
Registration form is loaded successfully. All fields are visible and interactive.
Test Steps
1. Refresh the registration form page.
2. Enter valid data in all mandatory fields (Full Name, Email, Password, Gender, Country).
3. Do not check the Terms & Conditions checkbox.
4. Enter the correct captcha.
5. Click the Submit button.
Expected Result
Form submission should be blocked. An error message should appear stating: “Please accept the Terms and Conditions before submitting.”
Actual Result
The form did not submit. The system displayed the validation message: “Please accept the Terms and Conditions before submitting.”
Test Status
Passed
Observation
The form correctly validates the Terms & Conditions checkbox. Submission is blocked until the checkbox is checked.
Remarks
Validation mechanism ensures compliance with user consent requirements.
Test Case 4 – Form Submission With Missing Mandatory Fields
Parameter
Details
Test Case ID
TC_04
Objective
To verify that the form blocks submission if mandatory fields are missing or left empty.
Preconditions
Registration form is loaded successfully. All fields are visible and interactive.
Test Steps
1. Refresh the registration form page.
2. Fill some mandatory fields, but leave at least one field empty (e.g., Email).
3. Fill Gender and Country dropdown.
4. Check the Terms & Conditions checkbox.
5. Enter the correct captcha.
6. Click the Submit button.
Expected Result
Form submission should be blocked. An error message should appear stating: “Please fill all mandatory fields.”
Actual Result
Submission was blocked. The system displayed the error message: “Please fill all mandatory fields.”
Test Status
Passed
Observation
The form validation correctly identified missing mandatory fields and prevented submission.
Remarks
Ensures that all required data is collected before form submission.
Test Execution Result
Console Output
TestNG Execution Result
Summary
All test cases passed successfully, confirming that the registration form validation, captcha verification, and input handling mechanisms are functioning as expected under different test conditions.
Author
Saurabh Kisan Butale Automated Form Testing using Selenium and TestNG
About
Automated Form Filling Using Selenium and TestNG — a project that automates the process of filling and validating a registration form with captcha verification using Selenium WebDriver and TestNG.