API Testing

One of the hardest and most confusing parts of a testing guide. This type of testing is very important in every aspect of testing the product, site, app, or else.

API Testing - is a type of software testing that involves testing application programming interfaces (APIs) directly and as part of integration testing to determine if they meet expectations for functionality, reliability, performance, and security.

For easier to understand, every client-server or client-server-client app is connected with each other by API requests. These APIs can have their own response codes and parts of the request like header and body.

There are three types of output that can be tested during the API testing:

  1. Any type of data (it is like attribute, attribute b, etc.);
  2. Status (say Pass or Fail);
  3. Call another API function (this can have a couple of returns, return value based on input condition, or update data structure).

 

Here are a couple of tips about best practices  of API testing:

  • Test cases should be grouped by test category;
  • On top of each test, you should include the declarations of the APIs being called;
  • Parameters selection should be explicitly mentioned in the test case itself;
  • Prioritize API function calls so that it will be easy for testers to test;
  • Each test case should be as self-contained and independent of dependencies as possible;
  • Avoid "test chaining" in your development;
  • Special care must be taken while handling one-time call functions like - Delete, CloseWindow, etc.;
  • Call sequencing should be performed and well-planned;
  • To ensure complete test coverage, create test cases for all possible input combinations of the API.

There are a lot of solution apps that are used for API testing. Everyone using that app prefers:

  • Postman;
  • Insomnia;
  • Cfix;
  • Runscope.

I will show an example of the simple API requests with simple explanations what and how it should be performed:

This guide is not the first you need to read about API testing, and you will know everything about it. It is like a general observation of what it is and how you as QA engineers need to perform it.

Copyright © 2019 - 2024 Mage Mastery. All rights reserved.