- Introduction
- π₯οΈ Features
- π§ͺ Test Cases Overview
- π Prerequisites
- π Project Setup
- ποΈ Directory Structure
- π¨ Configuration
- π·οΈ Known Issues
This project contains three test classes that automate various tasks using Selenium WebDriver with Java. Each class demonstrates a unique use case for web automation, including form submission, data scraping, and file handling.
- Automated Form Filling and Validation
- Tests the form-filling process on two different websites.
- Handles file uploads, checkbox clicks, and form submission validations.
- Web Scraping
- Scrapes table data from a financial website and writes it to a text file.
- Reusable Utility Functions
- Scroll, wait, and interact with web elements using utility methods.
- Headless Browser Support
- Demonstrates scraping in a headless browser environment.
Automates a form submission process on the Digital Unite Practice Form.
- Handles cookie consent pop-ups.
- Fills out text fields with sample data.
- Uploads an image file and selects checkboxes.
- Submits the form and validates the confirmation message.
@Test
void digitalUnite_formFillUp_confirmationMessage()Automates the registration process on the WP Everest Guest Registration Form.
- Randomized email and password generation.
- Selects dropdown values for nationality and country.
- Handles radio buttons, checkboxes, and calendar inputs.
- Validates success messages post-registration.
@Test
void wpEverestFormFillUp_confirmationMessage()Scrapes table data from the DSEBD Latest Share Price page.
- Operates in headless mode for efficient data extraction.
- Extracts HTML table data and writes it to a text file.
- Formats and logs the data for console output and storage.
@Test
void scrapData_htmlTable_textFile()-
Java Development Kit (JDK)
Ensure JDK 8+ is installed and configured.
-
Gradle
Install Gradle or use the wrapper script provided.
-
WebDriver
Download and configure the appropriate WebDriver
-
Dependencies
Add the following dependencies to your
build.gradlefile.- Selenium Java
- JUnit 5
- Any required utilities for file handling or browser-specific configurations.
-
Clone the repository:
git clone https://github.com/your-username/selenium-automation-project.git cd selenium-automation-project -
Build the project:
./gradlew build
-
Run the tests:
./gradlew test
src/
βββ main/
β βββ java/
β βββ resources/
βββ test/
βββ java/
β βββ Q1_DigitalUnite.java
β βββ Q2_wpEverest.java
β βββ Q3_dsebd.java
βββ resources/
βββ scrapData.txt
βββ myImage.jpg
Ensure the following dependencies are included in your build.gradle:
dependencies {
testImplementation platform('org.junit:junit-bom:5.10.0')
testImplementation 'org.junit.jupiter:junit-jupiter'
implementation group: 'org.seleniumhq.selenium', name: 'selenium-java', version: '4.27.0'
}
- Custom Utility Class
- Includes helper methods for tasks like scrolling, waiting, and handling repetitive actions.
-
File Path Configuration:
Ensure the file paths for the resources (e.g.,
myImage.jpg,scrapData.txt) match your environment. -
Delayed Form Validation:
Some forms might display confirmation messages with a delay. The tests account for such cases with dynamic waits.



