This repository contains a Hybrid Automation Framework built for testing the nopCommerce Admin Demo application.
The framework is designed using Selenium WebDriver, Pytest, and Page Object Model (POM)
- ✅ Hybrid Framework (combination of Page Object Model + Utilities + Config-driven setup)
- ✅ Cross-browser support (Chrome, Firefox, Edge, Headless mode)
- ✅ Configuration-driven (URL, credentials stored in
config.ini) - ✅ Custom logging for detailed execution reports
- ✅ Reusable Pytest fixtures for WebDriver setup
- ✅ Screenshot capture for failed/validated test cases
- ✅ Scalable test structure (easy to add new test cases/pages)
Here is how the project is organized. Each folder and file has a clear responsibility.
nopCommerce_Store_Demo
├── 📂 configuration
└── config.ini # Stores environment details like URL, username, password
├── 📂 logs
└── automation.log # Stores logs for each test execution
├── 📂 pageObjects
└── LoginPage.py # Page Object class for login page
└── DashboardPage.py # Example for dashboard page
├── 📂 testCases
└── conftest.py # Pytest fixtures (browser setup, teardown, hooks)
└── test_login.py # Test case that verifies login functionality
└── test_dashboard.py # Example test case for dashboard
├── 📂 utilities
└── readProperties.py # Reads values from config.ini
└── customLogger.py # Provides reusable logging utility
├── 📂 reports
└── pytest_report.html # Stores HTML reports of test execution
├── 📂 screenshots
└── failed_test.png # Stores screenshots of failed test cases
├── requirements.txt # List of required Python packages
├── pytest.ini # Pytest configuration (markers, options)
├── run.bat # Batch file for test execution
- Page Object Model (POM): Each web page is represented by a Python class with its own locators and methods. This avoids code duplication.
- Cross-browser Testing: You can run tests on different browsers (Chrome, Firefox, Edge) by passing a parameter.
- Configuration Management: Common values like URL and login credentials are stored in
config.ini. This avoids hardcoding values inside test cases. - Custom Logging: Every step in the test execution is logged into
logs/automation.logfor easy debugging. - Screenshots on Failure: If a test fails, the framework automatically captures a screenshot and saves it inside the
screenshots/folder. - Reports: After execution, a clean HTML report is generated inside the
reports/folder showing test results. - Pytest Fixtures: Fixtures in
conftest.pyhandle browser setup and teardown in a reusable way. - Grouping Tests: You can mark tests as
sanityorregressionand run them selectively.
- Install Python 3.11+
- Install pip (Python package manager)
- Install browser drivers (e.g., ChromeDriver, GeckoDriver)
All required packages are listed in requirements.txt. Install them with:
pip install -r requirements.txt
Run all tests with Chrome (default):
pytest -v -s --html=reports/report.htmlRun tests in parallel (using pytest-xdist):
pytest -v -s -n=3 --browser chrome --html=reports/report.html-
Integrate with Jenkins CI/CD for automated execution.
-
Add Allure Reports for advanced reporting.
-
Implement Data Driven Testing using Excel (openpyxl).
- 👨Author
Developed by Bhushan
Contact: ambilkarbhushan25@gmail.com
This project is open for learning and contributions. Feel free to fork and enhance it.