Automated API Testing Introduction
API testing is a type of software testing that focuses on verifying that an application programming interface (API) works as expected. APIs allow different software systems to communicate with each other by defining a set of rules for requests and responses. Testing APIs ensures that they return the correct responses and handle various input scenarios, errors, and performance requirements.
We will cover basic automated API Testing with Python, Java, and JavaScript.
Any GET call for an API you can access via your web browser. We will be using this get url for our examples https://jsonplaceholder.typicode.com/todos/1. If you put in your browser right now you should see this:
Select the “Pretty-print” check box to make the response easier to read.
Python
We will use requests library. If not already installed, install requests with:
The Test Code
- Makes a GET request to the API passing in our URL.