This is a modular and scalable test automation framework built with Selenium WebDriver, Java, and TestNG for automating key functionalities of an e-commerce website.
- Language: Java
- Frameworks: Selenium, TestNG
- Build Tool: Maven
- Reporting: ExtentReports
- Logging: Log4j2
- CI/CD Support: Jenkins (configurable)
- Data Handling: Apache POI (Excel), json
- Design Pattern: Page Object Model (POM)
MyEcommerceProject/
│
├── src/
│ ├── main/
│ │ ├── java/com/ecommerce/
│ │ │ ├── actiondriver/ # Reusable UI actions (click, type, wait, etc.)
│ │ │ ├── actioninterface/ # Action interfaces for driver abstraction
│ │ │ ├── base/ # BaseClass: WebDriver setup, teardown
│ │ │ ├── pageobjects/ # Page classes for POM design
│ │ │ └── utility/ # ConfigReader, Logger, ExtentReport setup, ExcelUtil, JsonDataReader
│ │ └── resources/ # Log4j2 config
│
│ ├── test/
│ │ ├── java/com/ecommerce/testcases/ # TestNG test classes
│ │ └── resources/TestData/ # Excel & JSON data for DDT
│
├── Configuration/
│ └── Config.properties # Environment config: browser, URL, timeouts
│
├── Screenshots/ # Captured on test failure
├── logs/ # Log files from Log4j2
├── test-output/ # TestNG default report output, Extent Report
├── pom.xml # Maven dependencies and build config
├── testng-smoke.xml # Smoke test suite
├── testng-regression.xml # Regression test suite
└── .gitignore
- 📦 Modular Framework: Built using Page Object Model for maintainability.
- 📊 Advanced Reporting: Integrated ExtentReports with screenshots on failure.
- 🔐 External Config Support: Manage browser & test environment through
Config.properties
. - 📁 Data-Driven Testing (DDT): Read data from Excel using Apache POI & also read additional data from JSON
- 📄 Grouped Test Suites: Separate
testng-smoke.xml
andtestng-regression.xml
. - 🪵 Robust Logging: Log4j2 for granular logging and test debugging.
- 📸 Screenshots on Failure: Automatically captured and stored in
Screenshots/
.
Test Cases | Description |
---|---|
LoginPageTest | Validates login functionality(both valid and invalid data) |
RegisterUserTest | Automates user registration with data-driven input |
ProductsPageTest | Validates 'All Products' view and product presence |
SearchProductTest | Searches for products and verifies search results |
CartTest | Adds products to cart, updates quantity, validates total |
CheckoutTest | Checkout after login, Add product to cart > Register > checkout |
-
Clone the repo
git clone https://github.com/DKundu22/MyEcommerceProject.git cd MyEcommerceProject
-
Update
Config.properties
- Set browser, base URL, implicit waits, etc.
-
Run via Maven
mvn clean test -DsuiteXmlFile=testng.xml
-
Run specific suite
mvn test -DsuiteXmlFile=testng-smoke.xml
-
View Reports
- Navigate to
/test-output/
for TestNG default reports - Navigate to
/ExtentReports/
(or custom folder) for advanced HTML reports
- Navigate to
Screenshots of failure are stored under Screenshots/
and attached in ExtentReports.
Note: This is an ongoing project. I am working on this project & will add more test cases. I am also working on the improvements of this framework.
Debopriyo Kundu