This repository contains automated test scripts for the OrangeHRM Demo Website, leveraging the Pytest framework and Selenium Grid for distributed execution. The automation covers various website features, including login, employee management, and more.
- Pytest Framework – A simple and powerful testing framework for automation.
- Selenium Grid Integration – Enables parallel test execution across multiple environments and browsers.
- Page Object Model (POM) – Organizes test scripts in a structured way for better maintainability.
- Logging – Captures test execution details for debugging and analysis.
- Reporting – Generates test execution reports for easy tracking of test results.
- Screenshot Generation – Captures screenshots on test failures to help with debugging.
git clone https://github.com/automatealchemist/Orange_OpenSource_Live_Pytest_Selenium_Grid.git
cd Orange_OpenSource_Live_Pytest_Selenium_Gridpython -m venv venv # Create virtual environment
source venv/bin/activate # On macOS/Linux
venv\Scripts\activate # On Windowspip install -r requirements.txt-
Start Selenium Grid Hub
java -jar selenium-server-4.29.0.jar hub --host 0.0.0.0 --port 4444
-
Start a Node and Register it with the Hub
java -jar selenium-server-4.29.0.jar node --hub http://172.18.208.1:4444
pytestpytest --grid-url http://172.18.208.1:4444/wd/hub --browser chromepytest -n 3 --html=reports/report.htmlFor detailed reporting with logs and screenshots, run:
pytest -v --html=reports/report.html|-- tests/ # Contains test cases
|-- pageObjects/ # Page Object Model (POM) classes
|-- logs/ # Stores log files
|-- reports/ # Stores test execution reports
|-- TestData/ # Contains test data for script execution
|-- conftest.py # Pytest configuration file
|-- requirements.txt # List of dependencies
|-- README.md # Project documentation
- Ensure ChromeDriver or the required WebDriver is installed and compatible with your browser.
- Selenium Grid must be running before executing tests in a distributed environment.
Feel free to fork this repository and contribute improvements by creating a pull request.