API TESTING INTERVIEW QUESTIONS
--
List of most important API testing interview questions.
API stands for Application Programming Interface. Generally, APIs are used to establish the interaction between two different applications. When API is used over a web network, we call them ‘Web Services’. In recent times APIs have become the backbone of programming. As in an application, writing APIs to communicate with the database, or with another module has become a common practice now and that is why as a tester we must test the APIs for maximum test coverage.
1- What are the main challenges you face in the API testing in your project?
Challenges are for example,
API documentation
Access to the database
Call sequencing
2- What is the difference between the PUT and the POST method?
This is the most common API testing interview question these days.
- Firstly, the POST request means creating a new object in the database.
- Secondly, a PUT request means updating the existing object in the database with the new value.
3- What are the most commonly used HTTP methods?
For example:
GET- Used to retrieve data from the serverPOSTcreate a new object in the server
PUT- Used to update an existing object in the serverDELETEused to delete data from the server
4- List a few authentication techniques used in API testing.
- Session / Cookies based Authentication
- Basic Authentication
- Digest Authentication
- OAuth
Above all are the few most important authentication techniques.
5- What is the REST API?
REST — Representational State Transfer, is a set of functions that helps developers performing requests and receive responses. Interaction is made through HTTP protocol in REST API.
6- What exactly you verify in API testing?
Accuracy of data
HTTP status code
Response time
Error codes if API returns an error
Authorization
Performance
Security
Above all are the most important verification checks.
7- Differentiate API testing and UI testing.
UI (User Interface) testing means testing the graphical user interface. The focus of UI testing is on the look and feel of the application. Like how the user interacts with the application elements, such as images, font, layout, etc.
API testing allows communication between two software systems. It determines if the developed APIs meets the expectation regarding functionality, reliability, performance, and security. It works on the backend and also knows and the backend testing. To clarify, describe some scenarios while answering this question in an interview.
8- What protocol RESTFUL Web services use?
RESTFUL web services use the HTTP protocol as the medium of communication between client and server.
9- Can we use POST instead of PUT to create a resource?
Yes, we can because POST is the superset of all HTTP requests except GET requests.
10- What do you understand by payload?
Payload/body is a secured input data that is sent to API to process the request. The payload is generally constructed in JSON format in REST API.
11- Explain the main differences between API and Web Service?
- All web services are APIs but not all APIs are web services.
- A web service uses only three styles of use: SOAP, REST and XML-RPC for communication whereas API may be exposed to in multiple ways.
- A web service always needs a network to operate while APIs don’t need a network for operation.
- Web services might not contain all the specifications and cannot perform all the tasks that APIs would perform.
12- List the advantages of API Testing
- Compatibility and easy integration with GUI: Simple integration would allow new user accounts to be created within the application before a GUI test started.
- Language-Independent: In API testing, data is exchanged using XML or JSON. These transfer modes are completely language-independent that allows users to select any coding language while adopting automation testing services for the project.
- Time Effective: In comparison to functional GUI testing API testing usually is less time-consuming. The web elements in GUI testing must be polled, which makes the testing process slower. Particularly, API test automation requires less code so it can provide better and faster test coverage compared to GUI test automation.
- Test for Core Functionality: API testing provides the ability to access the application without a user interface. The core and code-level functionalities of the application will be tested and evaluated early before the GUI tests. This helps in detecting the minor issues which can become bigger during the GUI testing.
13- What is API Automation?
We often need to automate the test cases which are repeatedly executed in every sprint. Like regression cases. Similarly, in the case of API testing, there are some cases that we need to execute before every release and those cases should be automated.
There are many tools for API automation like-
SOUP UI
Katalon studio
Postman
Jmeter
RestAssured
CloudQA TruAPI
14- Is there any upper limit for a payload to pass in the POST method?
Theoretically, one can pass unlimited data as the payload to the POST method. But, while considering a real use case, then sending a POST with a large payload will consume large bandwidth. It will take more time and cause performance challenges to the server.
15- What is REST parameters?
The REST API has four types of parameters:
Request parameters — These are submitted as JSON parameters present in the request.
Header parameters — These are present in the request header.
Query string parameters — These are provided at the endpoint of the query.
Path parameters — These are provided in the endpoint path.
For the complete list of API Testing Interview Question visit: