A robust test automation framework designed to validate the functionality of the Amazon e-commerce website, built with Java, Selenium, TestNG, and Cucumber following industry best practices including BDD and Page Object Model.
- ✅ Valid search using search button and Enter key
- 🏷️ Department-specific search (Electronics, Books, etc.)
- 💡 Autocomplete suggestions validation
- ❌ Edge cases: empty, invalid, and extremely long queries
- ✅ Positive login flows with valid credentials
- ❌ Negative testing with invalid credentials
- 🔄 Session persistence validation across navigation
- ✅ Mandatory field validation
- 📋 Registration form error handling
- 💳 Complete checkout process testing
- ❌ Negative scenarios with invalid payment details
- 🔍 Error handling validation
- 🎨 Critical UI elements verification (logo, banners)
- 🖼️ Broken images detection
- 🔗 Dead links identification
| Category | Technology | Purpose |
| Programming Language | Java 11+ | Core development language |
| Web Automation | Selenium WebDriver | Browser automation and interaction |
| Testing Framework | TestNG + Cucumber | Test execution and BDD scenarios |
| Build Tool | Apache Maven | Dependency management and build automation |
| Reporting | Extent Reports | Rich HTML test reports |
| Data Handling | Apache POI | Excel operations for test data |
| Driver Management | WebDriverManager | Automatic browser driver management |
| Logging | Log4j 2 | Comprehensive logging system |
.
├── pom.xml # Maven Project Object Model
├── testng.xml # TestNG suite for test execution
│
└── src
└── test
├── java
│ ├── base # Core framework setup (DriverFactory, BaseTest)
│ ├── pages # Page Object Model classes (LoginPage, HomePage, etc.)
│ ├── runners # TestNG Cucumber runner
│ ├── stepDefinitions # Cucumber step definitions (glue code)
│ └── utils # Helper utilities (ConfigReader, ScreenshotUtils, etc.)
│
└── resources
├── features # Cucumber .feature files
├── config.properties # Main configuration file
├── log4j2.xml # Logging configuration
├── extent-config.xml # Extent Reports styling
└── testdata.xlsx # Test data for data-driven tests
| Requirement | Version | Download Link |
| Java JDK | 11 or higher | adoptium.net |
| Apache Maven | 3.6 or higher | maven.apache.org |
| Git | Latest | git-scm.com |
-
Clone the repository:
git clone https://github.com/anukul-hub/E-commerece-Capstone-project-amazon-automation.git cd E-commerece-Capstone-project-amazon-automation -
Install dependencies:
mvn clean install
-
Verify installation:
mvn clean compile
Run all tests:
mvn clean testRun specific test suite:
mvn clean test -Dsurefire.suiteXmlFiles=testng.xmlRun with specific browser:
mvn clean test -Dbrowser=chromeIntelliJ IDEA / Eclipse:
- Right-click on
testng.xml→ Run - Right-click on any feature file → Run Feature
- Right-click on
TestRunner.java→ Run
Rich, interactive HTML reports with detailed execution insights:
- 📍 Location:
test-output/extent-report.html - ✨ Features:
- Test execution dashboard
- Step-by-step execution details
- Embedded screenshots for failures
- Execution timeline and statistics
Standard BDD reports in multiple formats:
- 📍 Location:
target/cucumber-reports/cucumber.html - 📋 Formats: HTML, JSON
Automatic screenshot capture on test failures:
- 📍 Location:
test-outpt/screenshots/ - 🎯 Naming:
Scenario_TestName_Timestamp.png
Change the baseUrl, browser, and test user credentials here:
# Application Settings
baseUrl=https://www.amazon.in
browser=chrome
headless=false
explicitWait=25
# Test User Credentials
regMobile=your_mobile
regName=Anukul Chauhan
regPassword=tempPAss
# Reporting
reports.screenshots=true
reports.extent=trueModify the test suite to run specific classes or pass parameters to your tests:
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Amazon Automation Suite">
<test name="Smoke Tests">
<classes>
<class name="runners.CucumberTestRunner"/>
</classes>
</test>
</suite>