Sunday 29 May 2022

Top API Testing Interview Questions and Answers? Rest API testing interview questions with real time scenarios

 


API testing has been considered the future of software testing and it has advantages in the ability to test for Backend functionality, time effectiveness, language independence, and GUI integration. It becomes a must for software testing projects to ensure product quality and at the same time important part of Testing/SDET interview questions and asnwers. In below post we will check API Testing Interview Questions and Answers along with real time examples.


Content will be focused on below :
- REST API testing interview Questions
- Advanced API testing Interview Questions
- Rest Assured API Testing interview Questions for experienced

Explain what statelessness means in REST?

Ans: Statelessness means that the client and server don’t store information about each other’s state. Since the server stores no information, it treats each client request as a new request.

As a consequence, the following conditions would apply:

  • The client request contains all information required for the server to process the request
  • Client application is responsible for storing session state

 How to send Nested JSON object as payload?

Ans:
Ex: {“space”: {

“name”:”myspace”,

“id”:”sidharth″

}}

HashMap<String,Object> mainobj= new HashMap<String,Object>();

HashMap<String,String> subobj= new HashMap<String,String>();

subobj.put("name","QA");

subobj.put("id","sidharth");

mainobj.put("space",subobj);        

 

What is JSON Schema and how to perform Scheman Testing with Rest Assured?

Ans: Click Here For Answer With Code

What are the disadvantages of REST API?

Ans:

  • Doesn’t enforce security practices
  • HTTP method limits you to synchronous requests
  • Due to statelessness, you might be unable to maintain state (e.g. in sessions)

 

What is Input injection and what are different ways to simulate user input?

Ans::
Input Injection:  It is the act of simulating user input, in several ways you can simulate user input.

  • Direct Method Invocation
  • Invocation using an accessibility interface
  • Simulation using low-level input
  • Simulation using a device driver
  • Simulation using a robot

    What are some architectural styles for creating a Web API?

Ans::This is one of the fundamental Web API interview questions. Bellows are four common Web API architectural styles:

  • HTTP for client-server communication
  • XML/JSON as formatting language
  • Simple URI as the address for the services
  • Stateless communication

            

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

Ans: Click Here For Answer

Which purpose does the OPTIONS method serve for the RESTful Web services?

AnsThe OPTIONS Method lists down all the operations of a web service supports. It creates read-only requests to the server.

SDET Interview Question and Answers     TestNG Interview questions and answers

Jenkins Interview Questions and Answers.  
Appium Interview Questions and Answers


What is the major drawback of using SOAP?

AnsWhen using SOAP, users often get the firewall security mechanism as the biggest obstacle. This block all the ports leaving few like HTTP port 80 and the HTTP port used by SOAP that bypasses the firewall. The technical complaint against SOAP is that it mixes the specification for message transport with the specification for message structure.

What is the difference between 401 and 403?

Ans:  Click Here To Find Diff Between 401 & 403


When to use contract testing?

AnsContract testing is immediately applicable anywhere where you have two services that you need to communicate - such as an API client and a web front-end. Although a single client and a single service is a common use case, contract testing really shines in an environment with many services (as is common for a microservice architecture). Having well-formed contract tests makes it easy for developers to avoid version hell. Contract testing is a killer app for microservice development and deployment.


To learn more about the use of the pact in contract testing please refer: ContractTestingWithPact
What are the status codes you have come across in your API testing project?

Ans: Click Here For Status Codes

How to fix the error import io.restassured.RestAssured cannot be resolved?


Do you have the scope set to test when you are adding the mentioned dependencies? This limits the code from accessing that dependency's classes within the source code. That is, we can access those classes within your testsources (ex: ${project.dir}/src/test/java/<package>${project.dir}/test/<package>.


If that is not your intended use case, just remove the scope attribute.

  <dependency>
      <groupId>io.rest-assured</groupId>
      <artifactId>rest-assured</artifactId>
      <version>4.1.1</version>
  </dependency>

How to use mocking and create Stub with Wiremock for your integration tests?


Ans:Click Here For Answer With Code And Steps

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




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


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

Learn (API-Microservice)Testing+(CoreJava+UI)-SDET with Self Paced Videos and one LIVE Doubt Session

TRANING VIDEOS AVAILABLE with Live Doubt Session @4500/-(course-1 below,API TRaining Videos With ClassNotes and Coding Set) and 6500/- (API+UI, both course-1 & 2 below) Check Training Page for Course Content or reach out @whatsapp +91-9619094122

Entire course content can be found below:  COURSE CONTENT


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

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

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
Mobile Testing Interview Question Set:
https://automationreinvented.blogspot.com/search/label/Mobile%20Testing

Python Interview Question Set for QAE - SDET - SDE:
https://automationreinvented.blogspot.com/search/label/Python

No comments:

Post a Comment

All Time Popular Posts

Most Featured Post

API Status Codes with examples for QA-Testers

  🔺 LinkedIn: https://www.linkedin.com/in/sidharth-shukla-77b53145/ 🔺 Telegram Group:  https://t.me/+FTf_NPb--GQ2ODhl 🏮In API testing, it...