This project is a robust, modular Selenium Automation Framework designed to automate key user workflows of a demo E-commerce website using Java, Selenium WebDriver, TestNG, and Maven.
The framework follows industry best practices such as the Page Object Model (POM) with page factory, data-driven testing, reusable utilities, structured reporting, and cross-browser execution.
- End-to-end automation of E-commerce workflows
- Page Object Model (POM) architecture
- Cross-browser execution (Chrome, Firefox, Edge)
- Data-driven testing using Excel
- Selenium 4 advanced features (Relative Locators, CDP)
- Parallel execution using TestNG
- Retry mechanism for flaky tests
- Explicit, Implicit, and Fluent waits
- Advanced user interactions (Actions class)
- Screenshot capture for failures
- Extent HTML Reports & TestNG reports
- Centralized logging using Log4j2
This project demonstrates the following automation and testing concepts:
- Page Object Model (POM) with page factory implementation
- TestNG Annotations, Groups, Priorities & Dependencies
- Data-Driven Testing (Apache POI – Excel)
- Selenium WebDriver API
- Selenium 4 Features:
- Relative Locators
- Chrome DevTools Protocol (CDP)
- Multi-tab & window handling
- Synchronization:
- Implicit Wait
- Explicit Wait
- Fluent Wait
- Retry Logic using IRetryAnalyzer
- Maven lifecycle & Surefire plugin
- Logging & Reporting
- Modular and reusable framework design
| Technology | Purpose |
|---|---|
| Java | Programming language |
| Selenium WebDriver 4 | Browser automation |
| TestNG | Test framework |
| Maven | Build & dependency management |
| Apache POI | Excel data handling |
| Extent Reports | HTML test reporting |
| Log4j2 | Logging |
.
|-- pom.xml
`-- src
|-- main
| |-- java
| | `-- com
| | `-- selenium
| | `-- automation
| | `-- framework
| | |-- base
| | | `-- BasePage.java
| | |-- pages
| | | |-- CheckoutPage.java
| | | |-- HomePage.java
| | | |-- LoginPage.java
| | | |-- ProductDetailsPage.java
| | | |-- RegisterPage.java
| | | `-- ShoppingCartPage.java
| | `-- utils
| | |-- ActionsUtil.java
| | |-- ConfigUtil.java
| | |-- DropdownUtil.java
| | |-- ExcelUtil.java
| | |-- ExtentManager.java
| | |-- LogUtil.java
| | |-- RetryAnalyzerUtil.java
| | |-- ScreenShotUtil.java
| | |-- TestListener.java
| | `-- WaitUtil.java
| `-- resources
| |-- config.json
| |-- extentConfig.xml
| `-- log4j2.xml
`-- test
|-- java
| `-- com
| `-- selenium
| `-- automation
| `-- framework
| |-- base
| | |-- BaseTest.java
| | `-- BaseTestTNG.java
| |-- dataProvider
| | |-- ExcelDataProvider.java
| | `-- TestDataProvider.java
| `-- tests
| |-- CompleteUserWorkFlow.java
| |-- LoginFlowTest.java
| |-- LogoutFlowTest.java
| |-- ProductCheckoutFlowTest.java
| |-- RegisterFlowTest.java
| |-- SetUpTest.java
| `-- demo
| |-- ActionsClassAdvancedInteractionsTest.java
| |-- AlertIFrameWindowsTest.java
| |-- DataProviderTest.java
| |-- ElementHandlingTest.java
| |-- ExcelDataProviderTest.java
| |-- PriorityGroupsDependsOnTest.java
| |-- RetryTest.java
| |-- SeleniumFeatureTest.java
| `-- WaitTest.java
`-- resources
|-- LoginData.xlsx
|-- testng.xml
`-- testngTNG.xml
22 directories, 43 files
-
Ensure the following are installed
- Java 25
- Maven 3.9.11
- Browsers
- Google Chrome 143
- Edge 143
- Firefox 146
- Any IDE or terminal
-
Clone the repository
git clone https://github.com/devendraDPI/selenium-automation-framework-for-ecommerce-website.git- Navigate to the project folder
cd selenium-automation-framework-for-ecommerce-website- Run the test (using any one command)
mvn clean test # Runs on by default chrome browser
mvn clean test -Dbrowser=edge # Runs on edge browser
mvn clean test -Dbrowser=firefox # Runs on firefox browser
mvn clean test -Dbrowser=chrome # Runs on chrome browser- See how the Selenium Automation Framework for E-commerce Website works in this video walkthrough.
- MIT License: See License file for details.
