A robust, generic, and reusable Selenium WebDriver framework designed for scalability and ease of use. This project implements the Page Object Model (POM) pattern and supports data-driven testing using TestNG and CSV files.
.
├── src/
│ ├── main/
│ │ ├── java/
│ │ │ ├── config/ # Configuration and Report management
│ │ │ ├── driver/ # Browser and Driver lifecycle management
│ │ │ ├── data/ # Generic Data models for test cases
│ │ │ ├── page/ # Base Page and Page Object classes
│ │ │ └── util/ # Shared web and global utilities
│ │ └── resources/
│ │ └── general.properties # Environment and browser settings
│ └── test/
│ ├── java/
│ │ ├── test/ # Actual Test Classes
│ │ └── util/ # Base Test, Listeners, and Data utilities
│ └── resources/
│ └── testData/ # CSV files for Data-Driven testing
├── build.gradle # Dependency and task management
└── README.md # Project documentation
- Java JDK 11 or higher.
- Gradle (installed or via the included wrapper).
Update the src/main/resources/general.properties file with your environment details:
- browser: Specify the browser (e.g.,
chrome,firefox). - base.url: The URL of the application under test.
- timeout: Implicit wait duration in seconds.
- headless: Set to
trueto run tests without a browser UI.
Execute the following command in the terminal to run all tests:
./gradlew test
- Create a new class in the
pagepackage that extendsBasePage. - Use
@FindByannotations to identify WebElements. - Add methods for user actions following the naming conventions below.
- Create a test class in the
testpackage that extendsBaseTest. - Implement the
initialize()method to instantiate the required page objects using thecreateInstance()factory method. - Annotate your test methods with TestNG's
@Test.
- Add a CSV file to
src/test/resources/testData/. - Create a data model in
src/main/java/data/that extendsBaseData. - Use
TestDataUtils.loadData()to read the file contents into your test.
Each .java file should begin with the following comment block:
/**
* @author Abdullah Umar Nasib
* @since 12/02/2026
*/| Element | Prefix | Example |
|---|---|---|
| Button | btn | btnSave |
| Check box | chk | chkTerms |
| Dropdown list | ddl | ddlCountry |
| Link | lnk | lnkForgotPassword |
| Text box | txt | txtFirstName |
| Actionable Element | Prefix | Example |
|---|---|---|
| Button | click | clickSave() |
| Dropdown list | select | selectCountry() |
| Text box | enter | enterFirstName() |
- ExtentReports: Rich HTML reports are generated automatically in the
report/folder. - Screenshots: Upon test failure, the framework automatically captures a screenshot and embeds it into the ExtentReport.
- Formatting: Code formatting is managed via google-java-format.
- Selenium Java: Web automation core.
- WebDriverManager: Automatic driver binary management.
- TestNG: Testing framework.
- Owner: Property file mapping.
- ExtentReports: Reporting library.
- Lombok: Reducing boilerplate code.