Search the courses, subjects, tracks, games and features, or jump straight to a page.
Learn it your way
A short class with Sarah and her students. The other ways are under More.
Sign up free to listen. Transcripts are free to read.
Let's start by discussing HTTP status codes. Why do you think these codes are essential in API testing?
I think they indicate whether a request was successful or failed.
Exactly! For example, the status code 200 means a successful response, while 404 indicates that something was not found. Remember, '2xx means success.' Can anyone tell me what a 500 error represents?
It usually means there's a server error, right?
Right on! HTTP status codes help us determine the state of our API. Make sure to check these during your testing process.
We've talked about status codes. Now, let's focus on the actual response body. Why is it important to verify that the response contains the expected fields?
If the response fields are incorrect, it could lead to errors in the application.
Exactly! Testing response body fields ensures the app receives the correct data. For example, if you're expecting 'name' to appear, but it doesn’t, that's a problem!
Can this be automated in Postman?
Yes! You can write assertions in the Tests tab to validate field presence and values.
Let's dive into field data types. Why do you think we should validate that the fields returned have the correct data types?
Incorrect data types could cause the application to crash or behave unexpectedly.
Exactly! An 'id' should always be an integer, while an 'email' should be a string. Would anyone like to share how we check these in Postman?
I guess we could use assertions in the Tests tab to compare the data types.
Correct! Validation helps maintain application integrity.
Now, let’s talk about authorization. What happens when you try to access an API without valid credentials?
We should get a 401 Unauthorized response.
Exactly! It's essential to confirm that unauthorized requests are handled properly. This protects sensitive data. Make sure you test for this when creating your checklist.
Ensuring the API returns appropriate HTTP codes.
Checking the presence of expected fields in the API response.
Confirming the data types of fields in the response.
Verifying API access with valid/invalid tokens.
Testing with invalid inputs to ensure robust error handling.
Status code is the key, it tells you what you see; 2's for success, 4's for miss, 5's for server's hiss.
Imagine you're an API sending data. One day, a user asks for data but forgets their key (token); the API kindly replies, '401 Unauthorised, please check your key!'
To remember the HTTP methods: 'Get Some Perfect Triple-Decker Sandwiches' (Get, POST, PUT, DELETE).
RESPONSE: Verify Results, Ensure Status Code, Observe Necessary Fields, Safeguard Against Errors.
Term
What does a 200 status code mean?
Click to flip
Term
What is negative testing?
Click to flip
Term
Name one common HTTP method for creating resources.
Click to flip
Term
What does authorization testing involve?
Click to flip
Application Programming Interface; allows different software systems to communicate.
Numeric response code from the server indicating the status of the request.
The data returned by an API after a request is made.
Scripts used in Postman to validate responses.
Testing the API with invalid data to ensure proper error handling.
This section provides a comprehensive checklist for API testing focused on various types of validations and testing scenarios using Postman.
The API Testing Checklist for QA outlines essential checks such as validating status codes, response bodies, data types, authorization, and handling negative test cases. Each checklist item is crucial for ensuring a robust API testing process and reliability of the application.
API testing is a critical step in ensuring that applications function correctly when communicating over APIs. The checklist provided here serves as a guide for Quality Assurance professionals to systematically assess various aspects of an API during testing.
This checklist not only helps in ensuring the functionality of the API but also enhances its reliability, security, and performance.