This project showcases API automation using Robot Framework, a keyword-driven test automation framework.
This repository contains Robot Framework test scripts for API automation. It provides a structured and keyword-driven approach to testing RESTful APIs.
- Demonstrates API automation using Robot Framework.
- Keywords for common HTTP methods: GET, POST, PUT, PATCH, DELETE.
- Clear and modular project structure for easy maintenance and extension.
Before you begin, ensure you have the following installed:
-
Clone the repository:
git clone https://github.com/your-username/API-Automation-with-RobotFramework.git cd api-automation-robotframework
-
Install dependencies:
pip install -r requirements.txt
You can find API test scripts in the tests
directory. Each test file (*.robot
) contains individual test cases demonstrating various HTTP requests.
# Example test file: tests/api_tests.robot
*** Settings ***
Library RequestsLibrary
*** Test Cases ***
Example GET Request
${response}= Get https://jsonplaceholder.typicode.com/posts/1
Should Be Equal As Numbers ${response.status_code} 200
# Add more assertions as needed
Execute Robot Framework tests with the following command:
robot TestCase/
/API-Automation-with-RobotFramework
|-- TestCase/
| |-- API-Automation.robot
|-- devdata/
| |-- example.env.json
|-- .gitignore
|-- README.md
- TestCase/: Contains Robot Framework test files for API automation.
- devdata/: Contains files that define static data for your tests, such as JSON files.
- .gitignore: Specifies files and directories to be ignored by Git.