---Advertisement---

 API Test Cases and Interview Question and Answers (Level-1)

By Manisha

Published On:

---Advertisement---

Sample Test Cases

  1. Verify the API response status code is 200 OK.
  2. Verify the response format (e.g., JSON, XML).
  3. Validate all required fields are present in the response.
  4. Ensure correct GET, POST, PUT, DELETE methods are implemented.
  5. Verify endpoint URLs are correct.
  6. Check response time is within acceptable limits (e.g., <2 seconds).
  7. Validate API request parameters are correctly processed.
  8. Check for proper HTTP response headers (e.g., Content-Type).
  9. Ensure the response payload size is within limits.
  10. Validate that malformed requests return 400 Bad Request.

Interview Questions & Answers

Q1. What is an API?
A: An API is a set of protocols and tools for building software applications that interact with other systems.

Q2. What is the difference between GET and POST methods?
A: GET retrieves data; POST submits new data to the server.

Q3. How do you validate an API response?
A: By checking status code, response body, headers, and response time.

Q4. What tools can be used for API testing?
A: Postman, REST Assured, SoapUI, Swagger, JMeter.

Q5. What are HTTP status codes?
A: Codes that represent the result of the HTTP request (e.g., 200 OK, 400 Bad Request).

👉The Next Questions-2: API TEST CASES

---Advertisement---

Leave a Comment