Getting Started Selenium with python
This repository contains a Python-based Selenium automation framework for web application testing. It uses Pytest for test execution and supports data-driven testing via JSON files.
Project Structure
-
PageObjects/
Contains page object locators for web elements. -
TestCases/
Contains test case scripts and Pytest configuration. -
TestData/
Stores test data in JSON format. -
Utilities/
Utility modules for data reading and general helper functions.
Prerequisites
- Python 3.13+
- Google Chrome or Mozilla Firefox installed
Installation
Install required Python packages:
pip install pytest
pip install pytest-html
pip install selenium
pip install webdriver-manager
Running Tests
To execute all test cases:
pytest
Data-Driven Testing
Test data is stored in TestData/Test.json and loaded using Utilities.ReadJson.
Browser Configuration
Browsers are initialized based on the test data using the fixture `Initialize_Browser'.
Page Objects
Element locators are defined in PageObjects.Locators