A personal UI automation framework built with Python, Selenium WebDriver and PyTest using the Page Object Model (POM).
This project demonstrates practical UI test automation for an e-commerce web application, covering login validation, product verification, shopping cart operations and product sorting.
The purpose of this project is to demonstrate practical skills in:
- Python-based UI automation
- Selenium WebDriver
- PyTest test execution
- Page Object Model (POM)
- Reusable locators and page methods
- Maintainable automation structure
- Automated HTML test reporting
This is a personal portfolio project and contains no employer, client or confidential code.
| Technology | Purpose |
|---|---|
| Python | Programming language |
| Selenium WebDriver | Browser automation |
| PyTest | Test framework |
| pytest-html | HTML test reporting |
| Page Object Model (POM) | Test automation architecture |
| Google Chrome | Test browser |
The framework currently contains 6 automated test cases.
| # | Test Scenario | Expected Result |
|---|---|---|
| 1 | Verify valid user login | User successfully logs in |
| 2 | Verify invalid login is rejected | Appropriate error message is displayed |
| 3 | Verify products are displayed | Products are available on the inventory page |
| 4 | Verify product can be added to cart | Selected product is added to the cart |
| 5 | Verify product can be removed from cart | Selected product is removed from the cart |
| 6 | Verify products can be sorted by price | Products are sorted from low to high price |
AUTOMATIONPRO/
│
├── pages/
│ ├── __init__.py
│ ├── inventory_page.py
│ └── login_page.py
│
├── reports/
│ └── report.html
│
├── tests/
│ ├── __init__.py
│ ├── test_inventory.py
│ └── test_login.py
│
├── .gitignore
├── conftest.py
├── pytest.ini
├── README.md
└── requirements.txt
pages/
Contains Page Object classes, locators and reusable methods for interacting with application pages.
tests/
Contains PyTest test cases that validate application functionality.
reports/
Contains the generated HTML test execution report.
conftest.py
Contains shared PyTest fixtures and Selenium WebDriver configuration.
pytest.ini
Contains PyTest configuration and HTML reporting options.
requirements.txt
Contains the Python dependencies required to run the project.
git clone https://github.com/nikhilshendgetech-sudo/AutomationPro.gitcd AUTOMATIONPROpython -m venv .venvWindows:
.venv\Scripts\activatemacOS / Linux:
source .venv/bin/activatepip install -r requirements.txtRun all automated tests using:
pytest -vPyTest automatically discovers the test files inside the tests/ directory.
The project is configured through pytest.ini for HTML test reporting.
To explicitly generate the HTML report:
pytest --html=reports/report.html --self-contained-htmlThe tests use the publicly available SauceDemo practice application.
Application:
https://www.saucedemo.com/
The application provides a practice environment for demonstrating web UI automation.
The project uses pytest-html to generate an HTML execution report.
The report provides:
- Test execution summary
- Passed, failed and skipped test results
- Test duration
- Environment information
- Individual test details
- Test execution logs
The generated report is available at:
reports/report.html
A sample execution report is included in the reports/ directory.
The framework follows the Page Object Model (POM) design pattern.
Test Case
│
▼
Page Object
│
▼
Selenium WebDriver
│
▼
SauceDemo Application
Page-specific locators and actions are maintained inside the pages/ directory, while test scenarios are maintained separately inside the tests/ directory.
This separation keeps the test cases readable and makes the automation code easier to maintain.
PyTest
│
▼
conftest.py
│
▼
Create Chrome WebDriver
│
▼
Open SauceDemo
│
▼
Execute Test Cases
│
├── Login Tests
│
└── Inventory Tests
│
├── Product Validation
├── Add to Cart
├── Remove from Cart
└── Product Sorting
│
▼
Test Results
│
▼
HTML Report
This is a personal automation demonstration project created to showcase Python and Selenium UI automation capabilities.
The project uses a publicly available practice application and contains no employer, client or confidential information.