A production-grade Selenium WebDriver + Java + TestNG automation framework built using the Page Object Model (POM) design pattern. Supports cross-browser testing, parallel execution, data-driven tests, and automated HTML reporting.
selenium-automation-framework/
├── src/
│ ├── main/java/com/qa/
│ │ ├── pages/ # Page Object Model classes
│ │ │ ├── LoginPage.java
│ │ │ └── ProductsPage.java
│ │ └── utils/ # Utility/Helper classes
│ │ ├── ConfigReader.java
│ │ ├── ExtentReportManager.java
│ │ └── WaitUtils.java
│ └── test/
│ ├── java/com/qa/
│ │ ├── base/
│ │ │ └── BaseTest.java # WebDriver setup & teardown
│ │ └── tests/
│ │ ├── LoginTest.java # 7 login test cases
│ │ └── ProductsTest.java # 4 products test cases
│ └── resources/
│ ├── config.properties # Browser, URL, timeouts config
│ └── testng.xml # TestNG suite configuration
├── reports/ # Generated HTML reports (auto-created)
├── pom.xml # Maven dependencies
└── README.md
| Tool | Version | Purpose |
|---|---|---|
| Java | 11 | Programming language |
| Selenium WebDriver | 4.18.1 | Browser automation |
| TestNG | 7.9.0 | Test framework |
| Maven | 3.9+ | Build & dependency management |
| WebDriverManager | 5.7.0 | Auto browser driver management |
| ExtentReports | 5.1.1 | HTML test reporting |
| Log4j2 | 2.23.0 | Logging |
| Apache POI | 5.2.5 | Excel data-driven testing |
| Module | Test Cases | Type |
|---|---|---|
| Login | 7 | Functional + Data-Driven |
| Products | 4 | Functional + Regression |
| Total | 11 |
- Java 11+
- Maven 3.9+
- Chrome / Firefox / Edge browser
git clone https://github.com/sachindhule-qa/selenium-automation-framework.git
cd selenium-automation-frameworkmvn clean testmvn clean test -Dbrowser=firefox
mvn clean test -Dbrowser=edgeUpdate config.properties:
headless=true
After execution, HTML report is auto-generated at:
reports/ExtentReport.html
Open it in any browser to view detailed results with pass/fail status, logs, and screenshots.
Edit src/test/resources/config.properties:
base.url=https://www.saucedemo.com
browser=chrome
headless=false
implicit.wait=10
explicit.wait=15- Page Object Model (POM) — Separates UI locators from test logic
- Fluent Interface — Method chaining for readable test steps
- Data-Driven Testing — TestNG
@DataProviderfor multiple data sets - Singleton Pattern — Single ExtentReports instance across suite
- ThreadLocal — Thread-safe parallel test execution
Sachin Dhule — QA Automation Engineer
📍 Pune, Maharashtra, India
🔗 LinkedIn | GitHub
This project is licensed under the MIT License.