SeleniumProjectWith-Bdd-Pom-Java

πŸ§ͺ Selenium Test Automation Framework β€” BDD + POM + Java

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.


πŸš€ Projects Covered

Project URL Type
SauceDemo https://www.saucedemo.com E-Commerce
Automation Test Store https://automationteststore.com E-Commerce

πŸ› οΈ Tech Stack

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

πŸ“ Project Structure

β”œβ”€β”€ 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

βš™οΈ Prerequisites


▢️ How to Run

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 Scenarios

πŸ›’ SauceDemo (saucedemo.com)

# 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

πŸ›οΈ Automation Test Store (automationteststore.com)

# 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

πŸ”‘ Key Highlights


πŸ“ˆ Results

πŸ“Š Live Test Report

πŸ”— View Live Test Report


πŸ‘€ Author

Hammad Asif