This repository provides a template for starting new automation projects using the Robot Framework. The structure is designed to centralize variables and configurations, facilitate the creation of new test suites, and organize tests and settings in a practical and scalable way.
-
commom/constants.resource
: Contains constant variables, such as URLs and IPs, centralizing configuration values that can be shared across tests. -
tests/sample_test.robot
: Example test case. Each file in this directory represents a test suite, with organized scenarios configured to use centralized variables and hooks. -
hooks/HOOKS.resource
: Contains common keywords for suite and test case Setup and Teardown. These hooks facilitate the preparation and cleanup of the environment for each execution. -
libs/MyCustomLib.py
: This directory is intended for custom Python libraries. It enables the creation of custom keywords, extending the native functionality of the Robot Framework. -
requirements.txt
: Project dependencies for installation in a virtual environment. -
.gitignore
: Defines files and directories to be ignored by version control, such as virtual environment directories, logs, and intermediate test results.
-
Install Dependencies:
Ensure Python 3.8 or higher is installed on your machine. To keep the environment clean and isolated, it’s recommended to install dependencies in a virtual environment:
python -m venv env .\env\Scripts\activate
python3 -m venv env source env/bin/activate
After activating the virtual environment, install the Robot Framework and any other required libraries by running:
pip install -r requirements.txt
-
Configuration: Adjust the variables in
commom/constants.resource
according to the desired test environment. -
Running Tests:
To execute the test suites, navigate to the project directory and use the command:
robot tests/sample_test.robot
-
Test Structure:
- Setup and Teardown: Each suite and test case can be configured with Setup and Teardown routines, which can be adjusted in the
hooks/HOOKS.resource
file. - Variables and Constants: The
commom/constants.resource
file stores shared variables, ensuring easy maintenance and scalability.
- Setup and Teardown: Each suite and test case can be configured with Setup and Teardown routines, which can be adjusted in the
This project template is customizable and can be adapted for different automation scenarios. Contributions are welcome for improvements and new features.