Skip to content

iaccardo/API-Robot-Framework-Python

Repository files navigation

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:

Install Robot Framework

pip install robotframework

Install RequestsLibrary (for API requests)

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

  1. Get a list of user
  2. Get the user with ID=2
  3. Confirm that a code 404 is retrieved if a user is not found
  4. Create User From JSON File
  5. Update the new user created
  6. 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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published