Friday 3 December 2021

Top 60 API Testing Interview questions and answers? Refer for concepts, revision and interview preparation?

 


Flash News:

TRAINING SESSION for API - Microservice - SDET TESTING

Training Session for API-Microservice-SDET will start soon, for demo session soon please reach out on whatsapp @ 91-9619094122. For more details refer : https://automationreinvented.blogspot.com/p/test_14.html
========================

Check below link for question and answers with code:

Top API Interview Question 1-10

 

51. How to add .pem and .key file for authorization in testing an API using Postman?

Ans: Go to Postman Settings-->Certificate and then upload .pem under crt and key under key as shown in below screenshot:

Do remember to mention the server address under the host field



52. How to convert the API request in Postman to cURL command so that we can run it in the cloud setup?

Ans: In Postman tool go to the Code snippet and from the list select cURL as shown in below screenshot:


53. If we don't have the API endpoints, then how we can fetch it from the UI?

Ans: If it's a web application, then the Network tab under Developer tools will help to capture the endpoints.

54. Let's consider a scenario where the username and password is correct but we don't have access rights for any resources or  API which we are trying to access, then what should be the expected status?

Ans: Status code should be 403-Forbidden


55. How to Create a POJO class? How to convert Json to Pojo ?


56. What do you mean by asynchronous Rest Clients?

Ans: Asynchronous clients don’t have to wait for a response to continue working. Therefore, microservices in an app can continue to process and send data, even when one of their partner services runs into issues. This capability provides more reliable service to the user and can be especially valuable in cases where service availability is low or overloaded with demand.


57. What is the use of JSON-RPC?

Ans:  JSON-RPC is a protocol similar to XML-RPC, it is a remote procedure calls (RPCs), and uses JSON instead of XML format to transfer data.  While calls may contain multiple parameters, it only expects one result.


58. How to automate POST-PUT-PATCH method in API Automation?


59. Name two commonly used architectural approaches while using APIs?

Ans: 
        - SOA-service-oriented architecture
        - Microservices architecture



60. Let's assume you have an endpoint /users/{user_id} , 
      and if we provide user id which is not present in database, 
      then which status code we expect from server?


Ans: Status Code should be 404 NOT FOUND, because the user id is not present in the database.

***********************************************

How to run selenium tests from Jenkins? Maven and Jenkins Integration with Testng-Selenium?Run selenium maven project from command line?

Click Here For Steps with Screenshot

*********************************************** 



61. How to Create API Testing positive and negative scenario's from the provided API endpoint?

Ans: Click Here For Test Scenarios On API Testing


62. Assume that you have a response body as below, if you want to fetch all the key and value of id=2 then what method you will use?


63. If the request body for POST method is missing some mandatory field, then what will be the status code?

Ans:  400 bad request because when we send a post request all the mandatory field need to be present in request body.

64. How to Create Fake-API which can be used for Testing in Postman or Rest Assured? Very Useful for real-time practice

 Ans: Steps with Screenshot to Create API from Scratch - Click Here


65. What are most used API Status Codes?

200:  OK

201:  Created

204:  No Content

400:  Bad Request

401: Unauthorized

403: Forbidden

404: Not Found

302: Redirect

405: Method Not Allowed

422: Unprocessable Entity

417: Expectation failed

500: Internal Server Error


If you like my work and want to say thank you then spread the word or buy me a coffee :)

🍵🍵🍵🍵 Buy Me A Coffee  🍵🍵🍵🍵

*******************************************************************
For any doubts or career guidance, arrange a 1:1 call with me 


********************************************************************



Check below link for question and answers with code:

Top API Interview Question 1-10

*************************************************

SeleniumWebdriver Automation Testing Interview Questions:

API Testing Interview Question Set:
https://automationreinvented.blogspot.com/search/label/Rest-API

 
Kubernetes Interview Question Set
https://automationreinvented.blogspot.com/search/label/Kubernetes

 
Docker Interview Question Set
https://automationreinvented.blogspot.com/2020/02/top-18-docker-commands-for-aytomation.html

 
Linux Interview question Set
https://automationreinvented.blogspot.com/search/label/Linux

 
Automation Testing/SDET Framework Design
https://automationreinvented.blogspot.com/search/label/FrameworkDesign


Java Related Interview Question Set

https://automationreinvented.blogspot.com/search/label/Java


GIT Interview Question Set:
https://automationreinvented.blogspot.com/search/label/GIT


Coding Interview Question Set:
https://automationreinvented.blogspot.com/search/label/Coding%20Questions

 






1 comment:

  1. Very useful questions for automation testers. Keep up the good work.

    ReplyDelete

All Time Popular Posts

Most Featured Post

Introduction to Web Testing with Playwright

  Introduction to Web Testing with Playwright 📌  Telegram Group:  https://t.me/+FTf_NPb--GQ2ODhl 📌  YouTube channel:  https://lnkd.in/gGUG...