Tuesday, 15 March 2022

Top 80 API Testing Interview Questions for QA and SDET ? API Interview Questions 2022

 


Check below link for question and answers with code:

Top API Interview Question 1-10


 

71. Explain some API defects that you have found in your recent project?

Ans: 
-- Incorrect status code for the negative scenario.
-- Authorization error with valid users.
-- Incorrect error messages for the negative scenario.
-- API HappyPath isn't working in Gamma environments.
-- Missing exception handling
-- Performance issue 

72. How do we identify JSON Array and JSON Object ?

Ans:

JSONObject:

  • Contains named values (key->value pairs)
    • like {id : 1}
  • Order of elements is not important
    • a JSONObject of {id: 1, name: 'test'} is equal to {name: 'test', id: 1}.

JSONArray:

  • Contains only series values
    • like [1, 'value']
  • Order of values is important
    • array of [1,'value'] is not the same as ['value',1]
      JSON Object --> { "":""}
      
      JSON Array --> [ , , , ]

73. What verifications needs to be done during API testing?

Ans:

  1. All kind of scenarios with request Parameters- Mandatory and optional.
  2. Request URL and protcols
  3. Request formats validation- json,xml,plain text etc
  4. Request headers- Authentication and if there is some parameters passed in headers.
  5. Response format and validation
  6. Response error codes- 2x for valid, 4x for unauthorized access, 5x server errors etc.
  7. Query and Path parameter validations.

74. How to check API responses in mobile (Android/IOS) browser?

Ans: Using Fiddler or Charles Proxy. A proxy server is an intermediary for requests which travel from client to server and vice-versa.
A proxy can exist on the same machine as the client or server, it can also exist on a separate machine. This is the case for the setup we are going to use in the current context where we will have a client (mobile phone with an application we want to debug), a proxy server (our PC ) and a Server (which communicates with the client).



75. Explain the Authorization in API?

Ans:  Click Here For All API Auth

76. How to do Load Testing with Postman?

Ans: 
Step 1- Click on the arrow along with your collection in the collection listing

Step 2- Then click on the Run button to launch Collection runner

Collection runner is the part which is used for Load testing


Step 3- Collection runner has a lot of important parts to consider for load testing like Iterations, Delay as shown in below screenshot.



77. What is the difference between 401 and 403?

Ans:  Click Here For Differences between 401 & 403

78. How to validate schema in Rest Assured?

Ans:
 
From version 2.1.0 REST Assured has support for Json Schema validation.
 It can be validated using below command:

get("/users")
.then().assertThat()
.body(matchesJsonSchemaInClasspath("users-schema.json"));

matchesJsonSchemaInClasspath is statically imported from io.restassured.module.jsv.JsonSchemaValidator

79. How to automate POST/PUT/PATCH using Rest Assured?

Ans:  Click Here For Automation Code

80. How to fetch all cookies in rest Assured?

Ans:

// Get all cookies as simple name-value pairs
Map<String, String> allCookies = response.getCookies();
// Get a single cookie value:
String cookieValue = response.getCookie("cookieName");
REVISION:

36. 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

37. What are REstful Webservices?

Ans:Representational State Transfer (REST) is an architectural style that specifies constraints, such as the uniform interface, that if applied to a web service induce desirable properties, such as performance, scalability, and modifiability, that enable services to work best on the Web. 

So webservice which implements REST architectural style is called as Restful Webservices. For more info refer: https://docs.oracle.com/javaee/6/tutorial/doc/gijqy.html

38. What are the types of Status codes?

1xx informational response – the request was received, continuing process
2xx successful – the request was successfully received, understood, and accepted
3xx redirection – further action needs to be taken in order to complete the request
4xx client error – the request contains bad syntax or cannot be fulfilled
5xx server error – the server failed to fulfil an apparently valid request

3. What are the status codes you have come across in your API testing project?

Ans: Click Here For Status Codes

*******************************************************************
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

No comments:

Post a Comment

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...