Skip to content

API Test Automation Examples using Robot Framework for practicesoftwaretesting.com

Notifications You must be signed in to change notification settings

testsmith-io/api-test-automation-robotframework

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

API Test Automation with Robot Framework

API Test Automation with Robot Framework

This repository contains example scripts for API test automation using:

  • Robot Framework
  • Requests Library for API interaction

Features

  • Examples of GET, POST, and Protected API requests.
  • Clear demonstration of test automation practices with assertions and chaining requests.
  • Fully automated CI pipeline using GitHub Actions.

Test API

All examples in this repository are designed to work with the Practice Software Testing API, a publicly available API for learning and practicing software testing. You can explore the API documentation and endpoints here:
👉 Practice Software Testing API 👈

Examples Included

  1. GET Request: Fetch a list of brands with GET /brands.
  2. Login API: Authenticate using POST /login with an email/password payload.
  3. Protected API Request: Authenticate, then use a token to fetch data with GET /invoices.

Prerequisites

  • Python 3.7+
  • Robot Framework
  • Robot Framework Requests Library

Setup and Run

  1. Clone this repository:

    git clone https://github.com/testsmith-io/api-test-automation-robotframework.git
  2. Navigate to the project directory:

    cd api-test-automation-robotframework
  3. Set Up a Virtual Environment (Optional, Recommended) Using a virtual environment ensures that dependencies for this project are isolated from your global Python environment.

    Create a Virtual Environment

    In VS Code open the Command Palette (MacOs: CMD + SHIFT + P, Windows: CTRL + SHIFT + P)

    • In the Command Palette, type and select/type: Python: Select Interpreter.
    • Choose the Python interpreter you want to use from the list OR create a new one.

    This ensures VS Code uses the virtual environment for running and debugging.

  4. Install dependencies:

    pip install -r requirements.txt
  5. Run the tests:

    robot -d results tests/

Automated Workflow

The repository includes a GitHub Actions workflow to automatically execute the tests.

About

API Test Automation Examples using Robot Framework for practicesoftwaretesting.com

Resources

Stars

Watchers

Forks