A robust end-to-end test automation framework built with Selenium WebDriver, Java, and TestNG following the Page Object Model (POM) design pattern. Tests cover complex e-commerce workflows including multi-currency validation, dynamic cart management, and advanced product filtering.
| Project | URL | Type |
|---|---|---|
| SauceDemo | https://www.saucedemo.com | E-Commerce |
| Automation Test Store | https://automationteststore.com | E-Commerce |
| Tool | Purpose |
|---|---|
| Java | Programming language |
| Selenium WebDriver | Browser automation |
| TestNG | Test execution & assertions |
| Maven | Dependency management |
| Page Object Model (POM) | Maintainable design pattern |
| XPath & CSS Selectors | Element location strategies |
| Chrome / Firefox | Supported browsers |
βββ Configrations/
β βββ config.properties # Base URLs and browser config
βββ src/test/java/
β βββ pageObjects/
β β βββ automationteststore/ # Page Object classes (XPath & CSS)
β β βββ saucedemo/ # Page Object classes for SauceDemo
β βββ testCases/
β β βββ automationteststore/ # Test cases for Automation Test Store
β β βββ saucedemo/ # Test cases for SauceDemo
βββ reports/ # Test execution reports
βββ logs/ # Execution logs
βββ testng.xml # TestNG suite configuration
βββ pom.xml # Maven dependencies
Drivers/ folder)Clone the repository:
git clone https://github.com/HammadAsif-997/SeleniumProjectWith-Bdd-Pom-Java.git
cd SeleniumProjectWith-Bdd-Pom-Java
Run all tests:
mvn test
Run specific suite:
mvn test -DsuiteXmlFile=testng.xml
Switch browser (edit Configrations/config.properties):
browser=chrome # or firefox
| # | Test Case | Description |
|---|---|---|
| TC1 | Invalid Login | Login with wrong password, verify exact error message |
| TC2 | Valid Login | Login with correct credentials, verify redirect to inventory page |
| TC3 | Sort Products Low to High | Sort all products by price ascending, verify sort order is correct |
| TC4 | Cart Quantity & Total Validation | Add top 2 items to cart, verify cart count, item names, and total price match |
| # | Test Case | Description |
|---|---|---|
| TC1 | Add Dove Brand Item | Select Dove brand, sort by date, add newest item, verify cart count & total ($7.20) |
| TC2 | Add T-Shirts & Shoes | Sort by price, select items by size (Medium), add shoes with quantity 2 |
| TC3 | Skincare Sale Items | Filter sale & in-stock items from skincare section, verify cart total ($309.00) |
| TC4 | Menβs Items Ending With βMβ | Add items whose names end with βMβ, verify correct items appear in cart |
| TC5 | Multi-Currency Cart Validation | Switch between β¬, $, Β£ β add sale items from Makeup & Men sections, validate totals match across currencies, ensure cart reaches 15 items |
Hammad Asif