https://github.com/otakmager/seleniumpomdatadriven
Data-driven test automation framework using Selenium WebDriver, TestNG, and Apache POI. Tests various unit conversions from an online converter using a clean Page Object Model (POM) architecture, dynamic Excel data providers, structured logging, and ExtentReports.
https://github.com/otakmager/seleniumpomdatadriven
automated-testing data-driven-tests java page-object-model qa-automation selenium selenium-java selenium-webdriver testng
Last synced: about 1 month ago
JSON representation
Data-driven test automation framework using Selenium WebDriver, TestNG, and Apache POI. Tests various unit conversions from an online converter using a clean Page Object Model (POM) architecture, dynamic Excel data providers, structured logging, and ExtentReports.
- Host: GitHub
- URL: https://github.com/otakmager/seleniumpomdatadriven
- Owner: otakmager
- Created: 2025-05-16T04:23:50.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-05-16T06:32:22.000Z (about 1 year ago)
- Last Synced: 2025-06-18T18:46:58.512Z (11 months ago)
- Topics: automated-testing, data-driven-tests, java, page-object-model, qa-automation, selenium, selenium-java, selenium-webdriver, testng
- Language: Java
- Homepage: https://www.digitaldutch.com/unitconverter/
- Size: 229 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ๐ SeleniumPomDataDriven
This project implements **data-driven test automation** for unit conversions using [https://www.digitaldutch.com/unitconverter/](https://www.digitaldutch.com/unitconverter/) as the system under test. The project uses **Selenium WebDriver** in Java with the **Page Object Model (POM)** architecture and integrates **TestNG** and **Excel-based Data Providers** to cover dynamic testing scenarios across various measurement units.
> โ
Live base URL: [https://www.digitaldutch.com/unitconverter/length.htm](https://www.digitaldutch.com/unitconverter/length.htm)
> ๐ฆ GitHub Repo: [https://github.com/otakmager/SeleniumPomDataDriven](https://github.com/otakmager/SeleniumPomDataDriven)
---
## ๐งฑ Project Structure
```
SeleniumPomDataDriven/
โโโ src/
โ โโโ main/
โ โ โโโ java/
โ โ โโโ base/ # BaseTest & core setup
โ โ โโโ pageObjects/ # Page Objects
โ โ โโโ pageEvents/ # Page Events (logic layer)
โ โ โโโ keyword # Action & validation Keywords
โ โ โโโ utils/ # ExcelUtils, ReportManager, Constants
โ โโโ test/
โ โ โโโ java/
โ โ โโโ testCases/
โ โ โโโ LengthConverterTest.java
โ โ โโโ MassConverterTest.java
โ โ โโโ TimeConverterTest.java
โ โ โโโ UserInterfaceTest.java
โ โโโ resources/
โ โโโ datasets.xlsx # Test data for each converter sheet
โโโ logs/
โ โโโ app.log # Test log
โโโ reports/ # HTML reports generated via ExtentReports
โโโ screenshots/ # Failure screenshots (auto-captured)
โโโ testng.xml # Master suite file
โโโ README.md
```
---
## โ
Features
- ๐ก **POM (Page Object Model)** based design for maintainability and reuse
- ๐งช **Data-Driven Testing** using `.xlsx` files via Apache POI
- ๐งพ **HTML Reports** using ExtentReports
- ๐ธ **Screenshot on Failure**
- โ๏ธ **Logger Integration** with `log4j2` for test activity traceability
---
## ๐ How to Run
### 1. Clone the Repository
```bash
git clone https://github.com/otakmager/SeleniumPomDataDriven.git
```
### 2. Open in IntelliJ IDEA
- Requires: **IntelliJ IDEA Community Edition 2024.3.5**
- Uses: **Java JDK 17**
- Built-in: **TestNG plugin** (no external Maven setup required)
### 3. Run All Tests
- Right-click `testng.xml` โ **Run 'testng.xml'**
- HTML report will be created in the `/reports/` folder
---
## ๐ฆ Test Coverage
Each test class corresponds to a category of unit conversion or interaction:
| Test Class | Description | Sheet in Excel |
|---------------------------|----------------------------------|----------------------|
| [`LengthConverterTest`](https://github.com/otakmager/SeleniumPomDataDriven/blob/main/src/test/java/testCases/length/LengthConverterTest.java) | Convert between length units | `length` |
| [`MassConverterTest`](https://github.com/otakmager/SeleniumPomDataDriven/blob/main/src/test/java/testCases/mass/MassConverterTest.java) | Convert between mass units | `mass` |
| [`TimeConverterTest`](https://github.com/otakmager/SeleniumPomDataDriven/blob/main/src/test/java/testCases/time/TimeConverterTest.java) | Convert between time units | `time` |
| [`UserInterfaceTest`](https://github.com/otakmager/SeleniumPomDataDriven/blob/main/src/test/java/testCases/ui/UserInterfaceTest.java) | Basic smoke tests for UI access | *(no data source)* |
---
## ๐ Test Data Source
All test inputs are stored in [`src/test/resources/datasets.xlsx`](https://github.com/otakmager/SeleniumPomDataDriven/raw/refs/heads/main/src/test/resources/datasets.xlsx) with dedicated sheets per category.
Each sheet has the format:
```
Value1 | fromUnit | Value2 | toUnit
------------------------------------------------------------
12.5 | kilometers [km] | 12500 | meters [m]
...
```
The `ExcelUtils` dynamically reads rows and feeds them into tests via `@DataProvider`.
---
## ๐ Logs & Reports
- โ
Logs written to: [`logs/app.log`](https://github.com/otakmager/SeleniumPomDataDriven/blob/main/logs/app.log)
- โ
HTML test report: [`reports/test-report.html`](https://github.com/otakmager/SeleniumPomDataDriven/blob/main/reports/test-report.html)
- โ
Screenshots on failure: [`screenshots/`](https://github.com/otakmager/SeleniumPomDataDriven/tree/main/screenshots)
Log includes detailed info such as:
- Test start markers per method
- Excel data loading feedback
- Element interaction and assertion steps
---
## ๐ง Technologies Used
- Java 17
- Selenium WebDriver
- TestNG
- Apache POI (Excel reading)
- ExtentReports
- log4j2
- WebDriverManager
- IntelliJ IDEA CE 2024.3.5
---