Api Testing-2-17
Api Testing-2-17
19. How do you document an API functionality? What are the tools available for
achieving the same?
20. What is the most important difference between API testing and UI testing?
21. What are the major blockers or challenges faced while performing API testing?
22. What are the principles that need to be followed while performing API Testing?
23. What are the different bugs that can be found in API testing?
24. Define Test API.
25. What is Payload?
26. What is Run Scope?
27. What is the importance of caching mechanism?
28. Why is automated API testing useful?
29. What do you understand by Input injection?
30. What do you understand by the test environment for API?
31. Is it possible to hack API while testing?
32. How should we test the API security?
33. What do you understand by Big Bang Approach in testing?
34. How do you perform API Load Testing?
Introduction
API testing is a category of so ware testing that helps test systems defined as APIs
(Application Programming Interfaces) in terms of functionalities, performance,
reliability, security, and various other parameters. This testing helps test the business
logic of applications quickly and more effectively and helps identify bugs/defects in
the functionality of the application at the business logic layer of the so ware
application architecture as shown below:
In this article, we will see the most commonly asked interview questions for freshers
and experienced professionals in the field of API testing.
API testing is a category of so ware integration testing that deals with the testing of
Application Programming Interfaces (APIs) directly. It deals with checking if the APIs
developed work as expected in terms of reliability, functionality, security, and
performance of the business logic covered by the applications.
2. What is API?
API stands for Application Programming Interface that is useful for communication
between different so ware systems. It facilitates data exchange between systems
located in different remote places. They are nothing but a collection of functions that
are executable by other functions of the so ware application.
Examples of APIs: Amazon API, Google Map API, Twitter API, etc.
6. What are the most commonly used tools for API testing?
The most popularly used tool in the market is PostMan. This tool helps to create
manual and automated test cases for testing the APIs in a well-designed manner.
Apart from this, there are different tools like JMeter, Paraso SOAtest, SoapUI,
Apigee, API fortress, JUnit, etc.
Full system
functionality is As the name indicates, this testing
considered in API verifies whether the unit of code
testing as the API would works as expected or not in
be used by external isolation.
developers.
Core Functionality Testing: This kind of testing provides access to the entire
system without the need for a user interface. The functionalities of the
application would be evaluated end-to-end without the need for GUI (Graphical
User Interface) which helps in detecting issues that can prove to be bigger at the
time of GUI testing.
Time and Cost Effectiveness: This is usually less time-consuming when
compared to GUI testing. It also requires less code for testing the functionalities
thereby making it easier to set up and get faster access to test coverage. It also
results in effective cost savings for the project.
Language-Independent: The data transfer between the test platform to the
applications is done utilizing XML or JSON and is completely independent of the
languages used in developing the systems. The test automation suite can be
developed in any language.
Ease of Integration with GUI: API testing provides highly flexible test suites that
help in easier integration with the GUI tests. For instance, before the GUI test
cases are initiated, employing API test cases, we can create sample users that
can act as an initial base for the GUI tests.
11. What are the best practices that need to be followed for
writing test cases?
We need to write test cases that correspond with the perspective of end-users.
Steps defined in the test cases needs to be simple so that anyone can replicate
the steps.
Ensure that the test cases are reusable.
Define and set the priority of test cases.
Provide a valid description, test input parameters, test data, expected outcome
a er running the test cases so that we can compare the actual outcomes of the
test cases with the expected ones.
Make sure to develop test cases that cover negative test scenarios too.
Naming conventions need to be properly followed while developing test cases.
Review them regularly and update them as and when the functionality gets
updated.
Test data is the input data used by the testers to execute their test cases. This data
can be prepared either manually or by making use of tools. For instance, to test the
login functionality of an application, testers would need input data such as username
and password which constitutes the test data.
Throughput refers to the number of transactions per second that an application can
handle under the influence of lot of users (load). The API needs to ensure that
required throughput is met before it is deployed on production. We can identify this
by performing the Load Testing of the APIs. We can do this by identifying multiple
transactions of different priorities and check how many requests are successfully
passed in acceptable time governed by the SLAs (Service Level Agreements) defined
by us.
UI testing represents testing by using Graphical User Interface. The main area of focus
in this is to test the look and feel of the so ware application by focusing on how the
application is feasible for the end-users, do the functionalities of all the items shown
on the UI screen - images, fonts, buttons, layouts etc are appearing properly as
expected.
On the other hand, API testing ensures the testing of communication of data
between various so ware systems. It mostly falls under the validation of back-end
functionality.
23. What are the different bugs that can be found in API testing?
We can find the below bugs at the time of API testing:
Duplicate or missing API functionality
Failure to handle negative test cases
Failure to handle a sudden spike in load or stress
Reliability of the application behavior
Failure to handle requests securely
Unused flags
Unimplemented errors
Poor Performance
Issues in Multi-threading
Improper error responses
Improper status codes
Caching mechanism is the practice of storing data temporarily to retrieve data for
repeated requests. This increases the performance of the system by obtaining the
data from the cached copy instead of hitting the database and getting the original
data.
To test the security of the API during API testing, we need to validate 2 things:
Authentication: Whether the identity of the end-user is correct.
Authorization: Whether the user is allowed to access the resource.
We can also validate whether the TLS or the SSL certificate used over the HTTPS
protocol is valid or not.
Automation Testing
Web Services
Web API
REST API