Learn Api Testing: Rajkumarsm
Learn Api Testing: Rajkumarsm
API TESTING
RAJKUMAR SM
w w w . S o f t w a r eT e s t i n g M a t e r i a l . c o m
API Testing Tutorial www.SoftwareTestingMaterial.com
Table Of Contents
What is an API? 2
Page 1
API Testing Tutorial www.SoftwareTestingMaterial.com
What is an API?
API is an acronym and it stands for Application Programming Interface. API is a set of
routines, protocols, and tools for building Software Applications. APIs specify how one
Routine: a program that performs a particular task. Routine is also known as procedure,
function, or subroutine.
In simple words, API stands for Application Programming Interface. API acts as an
interface between two software applications and allows the two software applications to
communicate with each other. API is a collection of software functions that can be
Page 2
API Testing Tutorial www.SoftwareTestingMaterial.com
At a restaurant, you give an order based on the items available on the menu. A waiter in
the restaurant writes down your order and delivers it to the kitchen who prepares your
meal. Once the meal is ready, the waiter picks up your food from the kitchen and serves it
In this scenario, the waiter’s role is similar to an API. As a waiter, the API takes a request
from a source, takes that request to the database, fetches the requested data from the
If you are using a ight service engine say Expedia, where you search for ights on a
speci c date. Once you pass the data such as Source, Destination, Onward Date, and
Return Date and click on search. Expedia sends a request to airlines through an API as per
your search details. The API then takes the airline’s response to your request and delivers
API gets the request from the user and gives the response without exposing internal logic.
Page 3
API Testing Tutorial www.SoftwareTestingMaterial.com
API testing is a type of software testing that involves testing APIs directly and also as a
part of integration testing to check whether the API meets expectations in terms of
Page 4
API Testing Tutorial www.SoftwareTestingMaterial.com
In API Testing our main focus will be on a Business logic layer of the software architecture.
API testing can be performed on any software system which contains multiple APIs. API
testing won’t concentrate on the look and feel of the application. API testing is entirely
UI (User Interface) testing is to test the graphical interface part of the application. Its main
On the other hand, API testing enables communication between two different software
Page 5
API Testing Tutorial www.SoftwareTestingMaterial.com
Unit testing: To test the functionality of individual operation
Functional testing: To test the functionality of broader scenarios by using a block of
Load testing: To test the functionality and performance under load
Runtime/Error Detection: To monitor an application to identify problems such as
Security testing: To ensure that the implementation of the API is secure from
external threats
Interoperability and WS Compliance testing: Interoperability and WS Compliance
Penetration testing: To nd vulnerabilities of an application from attackers
Fuzz testing: To test the API by forcibly input into the system in order to attempt a
forced crash
Page 6
API Testing Tutorial www.SoftwareTestingMaterial.com
To verify whether the return value is based on the input condition. The response of
To verify whether the system is authenticating the outcome when the API is updating
To verify whether the API triggers some other event or request another API
To verify the behavior of the API when there is no return value
Page 7
API Testing Tutorial www.SoftwareTestingMaterial.com
requires less code so it can provide faster and better test coverage.
API Testing helps us to reduce the testing cost. With API Testing we can nd minor
bugs before the GUI Testing. These minor bugs will become bigger during GUI Testing.
So nding those bugs in the API Testing will be cost-effective to the Company.
API Testing is quite helpful in testing Core Functionality. We can test the APIs without
a user interface. In GUI Testing, we need to wait until the application is available to
Page 8
API Testing Tutorial www.SoftwareTestingMaterial.com
Basically, on API Testing, we send a request to the API with the known data and we
Data accuracy
Response time
Authorization checks
Page 9
API Testing Tutorial www.SoftwareTestingMaterial.com
1. Postman
2. SoapUI
3. Rest-Assured
4. JMeter
5. Karate DSL
6. Assertible
7. Apigee
8. API Fortress
9. Tricentis Tosca
10. Parasoft
Refer to this link to learn more about these API Testing Tools
Page 10
API Testing Tutorial www.SoftwareTestingMaterial.com
Unit testing is conducted prior to the process of including the code in the build
In unit testing, the scope of testing is limited, so only basic functionalities are
API TESTING:
In API testing, the scope of testing is wide, so all the issues that are functional are
Page 11
API Testing Tutorial www.SoftwareTestingMaterial.com
Proper call sequencing is required as this may lead to inadequate coverage in testing
Due to the absence of GUI, it is quite dif cult to provide input values
Reliability issues
Improper messaging
Multi-threaded issues
Improper errors
Page 12
API Testing Tutorial www.SoftwareTestingMaterial.com
Create test cases with all possible inputs combinations for complete test coverage
Don't miss the following articles on our website related to API Testing.
Page 13
For more Software Testing Tutorials, please visit
www.SoftwareTestingMaterial.com
THANK YOU!