End-to-end UI test automation framework built with Python, Selenium WebDriver, and PyTest — following the Page Object Model (POM) design pattern.
Automates a complete E-Commerce user journey on a practice application:
Login → Browse Shop → Add Product to Cart → Checkout → Enter Delivery Address → Validate Order Success
Tests are data-driven — the same flow runs with multiple products/users from a JSON file automatically.
| Tool | Purpose |
|---|---|
| Python 3.11 | Primary language |
| Selenium WebDriver 4.x | Browser automation |
| PyTest | Test runner & framework |
| Page Object Model | Framework design pattern |
| JSON | Test data management |
| pytest-html | HTML test reporting |
SeleniumFramework/
│
├── pageObjects/ # Page Object Model classes
│ ├── login_page.py # Login page actions & locators
│ ├── shop_page.py # Shop / product listing page
│ └── checkout_page.py # Checkout & order confirmation page
│
├── tests/ # Test files
│ └── test_e2e.py # End-to-end parametrized test
│
├── utils/ # Reusable utilities
│ └── browserutils.py # Base class with common browser methods
│
├── data/ # Test data
│ └── test_data.json # User credentials + product names
│
├── reports/ # Auto-generated (gitignored)
│ └── report.html # HTML test report
│
├── conftest.py # Shared fixtures, browser setup, screenshot hook
├── pytest.ini # PyTest configuration
├── requirements.txt # Project dependencies
└── .gitignore
- ✅ Page Object Model — locators and actions separated from test logic
- ✅ Data-Driven Testing — JSON-based parametrize, easy to add new test cases
- ✅ Cross-Browser Support — Chrome, Firefox, Edge via CLI flag
- ✅ Auto Screenshot on Failure — captured and embedded in HTML report
- ✅ HTML Reports — self-contained pytest-html report after every run
- ✅ Clean Separation — pages / tests / utils / data in separate folders
- ✅ Base Page Class —
BrowserUtilsinherited by all page objects
git clone https://github.com/Dipakthoughts/SeleniumFramework.git
cd SeleniumFrameworkpython -m venv venv
source venv/bin/activate # Mac/Linux
venv\Scripts\activate # Windowspip install -r requirements.txtpytestpytest --browser_name firefox
pytest --browser_name edgepytest -v -sOpen reports/report.html in your browser after the run.
Tests are parametrized using data/test_data.json:
{
"data": [
{
"userEmail": "rahulshettyacademy",
"userPassword": "Learning@830$3mK2",
"productName": "Blackberry"
},
{
"userEmail": "rahulshettyacademy",
"userPassword": "Learning@830$3mK2",
"productName": "Samsung Note 8"
}
]
}Add more rows to test with more products — no code changes needed.
========================= test session starts ==========================
collected 2 items
tests/test_e2e.py::test_e2e_order_flow[test_data0] PASSED [ 50%]
tests/test_e2e.py::test_e2e_order_flow[test_data1] PASSED [100%]
========================== 2 passed in 34.2s ===========================
Dipak Chavke — Junior QA Automation Engineer
- GitHub: github.com/Dipakthoughts
- Email: dipchawke6@gmail.com