20 API testing interview question

By | July 21, 2021

What is an API?

It stands for application programming interface. It enables two applications to communicate with each other.

It consists of subroutine definitions, logs and tools for creating application software.

Examples include: Amazon advertising API, Twitter API, You tube API etc

api testing interview questions
api testing interview questions

What are the main differences between API and web service?

  • All web services are APIs but all APIs are not web services.
  • Web services cannot perform all the tasks performed by an API and may not contain all the specifications of an API.
  • Web services use only three styles like SOAP, REST and XML-RPC for communication whereas API uses all multiple ways.
  • Web service always requires a network to operate while API doesn’t require Network for operation.
  • What are the limits of API usage?

Many APIs will have the limit set by the provider. Thus by estimating the usage and understand how that will impact the overall cost of the offering. Whether this will be a problem depends on how data is leveraged.

What are some of the architectural styles for creating a web API?

  • HTTP for client server communications.
  • XML/JSON for formatting language.
  • Simple URI for the address of the services.
  • Stateless communications.

What is API Testing?

It is the software testing that determines if the developed APIs meet expectations regarding the functionality, reliability, performance and security of the application.

What are the advantages of API testing?

  • Test for core functionality: the core and the code level functionalities will be tested before GUI tests.
  • Time effective: it takes less time compared to GUI tests. API tests have faster test coverage that results in less cost.
  • Language independent: In API data is exchanged using XML or JSON these transfer modes are completely language independent.
  • Easy integration with GUI: API enables high integration tests that are useful if you want to perform functional GUI tests before API testing.
  • What is test environment of API?
    • The Test environment of API requires the configuration of the database and server, depending on the software requirements.
    • When the installation process is complete, API is verified for the proper operation. Throughout the process the API called from the original environment is set up with different parameters to study the test results.

What are the Common API testing types?

  • Validation testing
  • Functional testing
  • UI testing
  • Load testing
  • Error detection
  • Security testing
  • Penetration testing
  • Fuzz testing
  • Interoperability and WS compliance testing

What is the procedure to perform API testing?

  • What is the procedure to perform API testing?
  • Choose the suite to add the test case.
  • Choose the test development mode
  • Demand the development of test cases for the required API methods.
  • Configure the control parameters of the application and then test conditions.
  • Configure method validation.
  • Execute the API test.
  • Check test reports and filter API test cases
  • Arrange all API test cases.

What Must be checked when performing API testing?

  • A request is raised to the API with the known data this way you can analyze the validation response.
  • Accuracy of data.
  • Schema validation.
  • Http status codes.
  • Data type, order, validation and completeness.
  • Authorization checks
  • Implementation of response timeout
  • Error codes in case API returns
  • Non functional testing like security and performance.

What is the best approach method to perform API testing?

  1. Defining the correct input parameters.
  2. Verifying the calls of two or more added value parameters.
  3. Defining the basic functionality and scope of the API program.
  4. Writing appropriate API test cases and making use of testing techniques such as equivalence class, boundary value etc.
  5. Testing case execution.
  6. Comparing the test result with the expected result.
  7. Verifying the API behavior under conditions such as connection to files and so on.

What are the tools that could be used for API testing?

What are the tools that could be used for API testing?

  • Katalon studio
  • Postman
  • SoapUi pro
  • Tricentis Tosca
  • Apigee etc

What are the difference between API and Unit Testing?

API TestingUnit Testing
Conducted by QA teamConducted by the development team
Mostly black box testingMostly white box testing
Aimed to assess the full functionality of the system for it will be employed by the end userUsed to verify whether each unit in isolation performs as expected or not.
Often run after the build is ready and authors do not have access to the source codeEach of the code modules must be ensured to pass the unit test before being built by the developers.

API enables communication between two separate software systems. A software system implementing an API contains functions or subroutines that can be executed by another software system.

While UI testing refers to graphical interface testing such as how users interact with the applications, application elements such as fonts, images, layouts etc. It deals with the look and feel of the application.

What are the major challenges faced in API testing?

  1. Parameter selection
  2. Parameter combination
  3. Call sequencing
  4. Output verification and validation
  5. Providing input value as GUI is not available in this case.

What are the testing methods that come under API testing?

  1. Unit testing and functional testing
  2. Load testing
  3. Discovery testing to list, create and delete the number of calls documented in API
  4. Usability and reliability testing
  5. Security and penetration testing
  6. Automation testing to create and run scripts that require regular API calls.
  7. End to end integration and web UI testing
  8. API documentation testing to determine its efficiency and effectiveness

What are the common API errors?

  1. Missing module errors
  2. Documentation errors
  3. Parameter validation errors
  4. Standard error expectation. There can be one or more warnings within an individual module.

What are the types of bugs found in API testing?

  1. Missing or duplicate functionality
  2. Fails to handle error conditions gracefully
  3. Stress
  4. Reliability
  5. Security
  6. Unused flags
  7. Not implemented errors
  8. Inconsistent error handling
  9. Performance
  10. Multi threaded issues
  11. Improper errors

What are the common protocols used in API testing

  1. JMS
  2. REST
  3. HTTP
  4. UDDI
  5. SOAP

Why API testing is considered as most suitable form of automation testing

  • It verifies all the functional paths
  • It provides the most suitable interface
  • It is easier to maintain and provides fast feedback.

Leave a Reply

Your email address will not be published. Required fields are marked *