This project uses Robot Framework with the RequestsLibrary to test REST APIs. It's built in Python and designed for validating endpoints such as user creation, update, and deletion using the Reqres test API.
Prerequisites Before running the tests, ensure you have the following installed: Python 3.x or higher Robot Framework RequestsLibrary for Robot Framework You can install these dependencies using the following commands:
pip install robotframework
pip install robotframework-requests
Project Structure Resources -- variables.robot Stores common variables like the base URL, API keys, and endpoints used throughout the test cases.
tests -- user_api_tests.robot Contains test cases for interacting with a user-related API endpoint. This file is the main test suite.
user_payload.json file that contains the data of the user to create
Test cases
- Get a list of user
- Get the user with ID=2
- Confirm that a code 404 is retrieved if a user is not found
- Create User From JSON File
- Update the new user created
- Delete the user created
Environment Configuration If your API requires authentication, you can include the API Key in the headers:
Troubleshooting 401 Unauthorized Error: If you are getting a 401 error, check your authentication headers or ensure that the API key/token is correct.