REST API Testing Tutorial: Sample Manual Test Case

What is REST API Testing?

REST API Testing is open-source web automation testing technique that is used for testing RESTful APIs for web applications. The purpose of rest api testing is to record the response of rest api by sending various HTTP/S requests to check if rest api is working fine or not. Rest api testing is done by GET, POST, PUT and DELETE methods.

Rest stands for Representational State Transfer. It is an architectural style and an approach for communication used in the development of Web Services. REST has become a logical choice for building APIs. It enables users to connect and interact with cloud services efficiently.

An API or Application Programming Interface is a set of programming instructions for accessing a web-based software application.

In other words, a set of commands used by an individual program to communicate with one another directly and use each other's functions to get information.

For example, a Google website can have API for various functions like search, translations, calendars, etc.

In general API's are like below, they have server name, paths.., etc

http://<server name>/v1/export/Publisher/Standard_Publisher_Report?format=csv

There are mainly 4 methods involve in API Testing like GET, POST, Delete, and PUT.

In this tutorial, you will learn-

How to Test REST API

API testing requires an application to interact with API. To test an API, you require two things,

Rest API can be tested with tools like:

Here we will be using Advanced Rest Client, below are the steps to get Advance Rest Client,

How to get Advanced Rest Client

  1. Hit the send button.
  2. You can click on DETAILS button to see the Response headers.

Here are the response details:

Validating the results

Mainly, for Web API Testing, we need to check response code, a response message, and response body.

Below are the various response code, one might encounter while API Testing.

Testing REST API Manually

REST API Test Tool

Challenges for API Testing

The interesting problems for testers are:

  1. To make sure that the test harness varies the parameters of the API calls in such a way that it verifies the functionality as well as expose the failures. It includes exploring boundary condition and assigning common parameters
  2. Creating interesting parameter value combinations for calls with two or more parameters
  3. Identifying the content under which the API calls have to be made. Which might include setting external environment conditions ( peripheral devices, files, etc.) as well as internally stored data that affects the API
  4. Sequencing API calls as per the order in which the function will be executed
  5. To make the API produce useful results from successive calls.

Summary:

 

YOU MIGHT LIKE: