This project implements a Keyword Driven Testing Framework using Python and Selenium. It allows you to define test cases in a YAML file and execute them using a Selenium-based automation script. The framework is designed to be modular, easy to use, and extendable.
The framework performs the following tasks:
- Reads test cases from a YAML file.
- Executes the test steps defined in the YAML file using Selenium.
- Validates the functionality of the SauceDemo website, including:
- Login functionality.
- Visibility of input fields and buttons.
- Navigation to the dashboard after successful login.
- Provides detailed logs of test execution.
- Name: Suman Gangopadhyay
- Email: linuxgurusuman@gmail.com
- Date: 1-Jan-2025
- Version: 1.0
- Code Library: Selenium
- Prerequisites:
- Python 3.x
- Selenium
- ChromeDriver
- PyYAML (for parsing YAML files)
Ensure Python 3.x is installed on your system. You can download it from python.org.
Install the required Python libraries using pip:
pip install selenium pyyaml webdriver-managerEnsure ChromeDriver is installed and matches your Chrome browser version. You can download it from ChromeDriver.
project/
│
├── SauceDemoMain.py # Main automation script
├── test_case.yaml # YAML file containing test cases
├── KeywordDrivenFramework.py # Framework to execute test cases
└── README.md # Project documentation-
Clone the repository or download the project files.
-
Navigate to the project directory:
cd project -
Run the framework:
python test_runner.py
test_cases:
- name: "Validate Login Functionality"
steps:
- action: "start"
- action: "validate_username_input_box"
- action: "validate_password_input_box"
- action: "validate_submit_button"
- action: "validate_login"
- action: "shutdown"This project is open-source and available under the MIT License. Feel free to use, modify, and distribute it as needed.
Contributions are welcome! Please fork the repository and submit a pull request with your changes.