Skip to content

End-to-end test automation framework for nopCommerce demo site | Python, Selenium Webdriver, Pytest | POM + Hybrid Framework

BhushanAmbilkar/Project_02_nopCommerce_selenium_python_webAutomation_framework

Repository files navigation

nopCommerce Automation Framework (Selenium + Python + Pytest)

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)


Features

  • 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)

Project Structure

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

Features Explained

  1. Page Object Model (POM): Each web page is represented by a Python class with its own locators and methods. This avoids code duplication.
  2. Cross-browser Testing: You can run tests on different browsers (Chrome, Firefox, Edge) by passing a parameter.
  3. Configuration Management: Common values like URL and login credentials are stored in config.ini. This avoids hardcoding values inside test cases.
  4. Custom Logging: Every step in the test execution is logged into logs/automation.log for easy debugging.
  5. Screenshots on Failure: If a test fails, the framework automatically captures a screenshot and saves it inside the screenshots/ folder.
  6. Reports: After execution, a clean HTML report is generated inside the reports/ folder showing test results.
  7. Pytest Fixtures: Fixtures in conftest.py handle browser setup and teardown in a reusable way.
  8. Grouping Tests: You can mark tests as sanity or regression and run them selectively.

Getting Started

1. Prerequisites

  • Install Python 3.11+
  • Install pip (Python package manager)
  • Install browser drivers (e.g., ChromeDriver, GeckoDriver)

2. Install Dependencies

All required packages are listed in requirements.txt. Install them with:

pip install -r requirements.txt

3. Run Tests

Run all tests with Chrome (default):

pytest -v -s --html=reports/report.html

Run tests in parallel (using pytest-xdist):

pytest -v -s -n=3 --browser chrome --html=reports/report.html

Future Enhancements

  • Integrate with Jenkins CI/CD for automated execution.

  • Add Allure Reports for advanced reporting.

  • Implement Data Driven Testing using Excel (openpyxl).

Authors

  • 👨‍Author

Developed by Bhushan

Contact: ambilkarbhushan25@gmail.com

This project is open for learning and contributions. Feel free to fork and enhance it.

About

End-to-end test automation framework for nopCommerce demo site | Python, Selenium Webdriver, Pytest | POM + Hybrid Framework

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published