Welcome to the Python Selenium Test Framework! This repository contains a modular and scalable Selenium-based test automation framework built with Python. It is designed to simplify web application testing by following best practices, including the Page Object Design Pattern and data-driven testing. The framework supports multiple browsers and allows for dynamic browser selection at runtime.
- Modular Design: Organize tests in a way that promotes reuse and maintainability.
- Page Object Model: Simplify the code and improve readability by separating page logic from test logic.
- Cross-Browser Testing: Run tests across multiple browsers seamlessly.
- Dynamic Browser Selection: Choose the browser at runtime for flexible testing.
- Data-Driven Testing: Easily run the same tests with different sets of data.
- Easy Integration: Works well with CI/CD tools to automate your testing pipeline.
To get started with the Python Selenium Test Framework, follow these steps:
-
Clone the Repository:
git clone https://github.com/Reddomgt/PythonSeleniumTestFrameWork.git cd PythonSeleniumTestFrameWork
-
Install Dependencies:
Use pip to install the required packages:
pip install -r requirements.txt
-
Setup WebDriver:
Make sure to download the appropriate WebDriver for your browser. Place it in your system's PATH or specify its location in the configuration file.
To run your tests, you can use the pytest
command:
pytest tests/
Here is a simple example of a test case using the framework:
from pages.login_page import LoginPage
def test_login_valid_credentials(driver):
login_page = LoginPage(driver)
login_page.open()
login_page.login("username", "password")
assert login_page.is_login_successful()
You can specify the browser type when running the tests:
pytest --browser chrome
This allows you to easily switch between browsers without changing your test code.
The framework follows a structured approach to keep everything organized. Here’s a breakdown of the main directories:
PythonSeleniumTestFrameWork/
│
├── tests/ # Test cases
│ ├── test_login.py
│ └── test_signup.py
│
├── pages/ # Page Object Models
│ ├── login_page.py
│ └── signup_page.py
│
├── drivers/ # WebDriver binaries
│ ├── chromedriver
│ └── geckodriver
│
├── utils/ # Utility functions
│ ├── config.py
│ └── logger.py
│
└── requirements.txt # Required packages
We welcome contributions to the Python Selenium Test Framework! If you would like to contribute, please follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch
). - Make your changes and commit them (
git commit -m 'Add new feature'
). - Push to the branch (
git push origin feature-branch
). - Create a pull request.
Please ensure your code follows the existing style and includes tests where applicable.
This project is licensed under the MIT License. See the LICENSE file for details.
For more information and to download the latest releases, visit our Releases page.
Explore the framework and contribute to its growth. If you have any questions, feel free to check the "Releases" section for updates and improvements.
Happy testing! 🧪