API Test Cases
API Test Cases
API Test Cases
API_TC_01 API HTTP method/HTTP Execute the API by using the valid API HTTP method
VERB TAMPERING
API_TC_02 Execute the GET API by changing the API HTTP method
to other than GET method (HEAD, POST, PUT, DELETE,
OPTIONS, TRACE, HACK)
API_TC_04 Execute the PUT API by changing the API HTTP method
to other than PUT method (HEAD, POST, GET, DELETE,
OPTIONS, TRACE, HACK)
API_TC_06 API PROTOCOL Execute the API by using the correct defined protocol
TAMPERING/STRICT
TRANSPORT SECURITY
API_TC_53 Execute the API beyond the SLA limit defined in API
gateway manager where API throttling is defined
API_TC_54 RESPONSE HEADERS Execute the API with all available methods (GET,
TESTING POST, PUT, DELETE)
API_TC_55 API DATA DRIVEN Execute the API using CSV data, for data driven testing
API_TC_56 Execute the API using JSON data, for data driven
testing
API_TC_57 API RESPONSE TIME Execute the GET method API as per API documentation
API_TC_59 API INPUT If your API expects numbers in the input, try to send
values such as negative inumbers, 0, and large digit
numbers
API_TC_60 API AUTOMATION Create monitors and auto schedule API test execution
everyday and publish API test report
TESTING TECHNIQUE WHAT TO VALIDATE FOR
POSITIVE (i) Validate data accuracy in response body i.e., the response payload is well-
formed (schema validation)
(ii) Validate HTTP status codes returned
(iii) Validate response time i.e., the API service responds within an expected
timeframe
(iv) Validate error codes in case API returns any errors
NEGATIVE Validate if the reponse error payloads contain the correct error messages, correct
error status code and no access or API details are provided to the user
NEGATIVE Validate if the reponse error payloads contain the correct error messages, correct
error status code and no access or API details are provided to the user
NEGATIVE Validate if the reponse error payloads contain the correct error messages, correct
error status code and no access or API details are provided to the user
NEGATIVE Validate if the reponse error payloads contain the correct error messages, correct
error status code and no access or API details are provided to the user
POSITIVE (i) Compare the whole response body content with the expected information
(ii) Compare each attribute value of the response
(iii) Compare matching with regular expression
NEGATIVE Validate if the reponse error payloads contain the correct error messages, correct
error status code and no access or API details are provided to the user
NEGATIVE Validate if the reponse error payloads contain the correct error messages, correct
error status code and no access or API details are provided to the user
POSITIVE (i) Compare the whole response body content with the expected information
(ii) Compare each attribute value of the response
(iii) Compare matching with regular expression
NEGATIVE Validate if the reponse error payloads contain the correct error messages, correct
error status code and no access or API details are provided to the user
NEGATIVE Validate if the reponse error payloads contain the correct error messages, correct
error status code and no access or API details are provided to the user
POSITIVE (i) Compare the whole response body content with the expected information
(ii) Compare each attribute value of the response
(iii) Compare matching with regular expression
NEGATIVE Validate if the reponse error payloads contain the correct error messages, correct
error status code and no access or API details are provided to the user
NEGATIVE Validate if the reponse error payloads contain the correct error messages, correct
error status code and no access or API details are provided to the user
POSITIVE (i) Compare the whole response body content with the expected information
(ii) Compare each attribute value of the response
(iii) Compare matching with regular expression
NEGATIVE Validate if the reponse error payloads contain the correct error messages, correct
error status code and no access or API details are provided to the user
NEGATIVE Validate if the reponse error payloads contain the correct error messages, correct
error status code and no access or API details are provided to the user
POSITIVE (i) Compare the whole response body content with the expected information
(ii) Compare each attribute value of the response
(iii) Compare matching with regular expression
NEGATIVE Validate if the reponse error payloads contain the correct error messages, correct
error status code and no access or API details are provided to the user
NEGATIVE Validate if the reponse error payloads contain the correct error messages, correct
error status code and no access or API details are provided to the user
POSITIVE Perform authorization checks
NEGATIVE Perform authorization checks
NEGATIVE Perform authorization checks
NEGATIVE Perform authorization checks
NEGATIVE Perform authorization checks
NEGATIVE Perform authorization checks
NEGATIVE Perform authorization checks
SECURITY Perform authorization checks
POSITIVE Send valid json in payload/body, as per API document i.e., the request payload is
well-formed (schema validation)
NEGATIVE Send invalid json in payload/body
NEGATIVE Send valid json in payload/body by writing more fields in the payload which are not
expected by database/server
NEGATIVE Send valid json in payload/body by writing less fields in the payload which are not
expected by database/server
POSITIVE (i) Compare the whole response body content with the expected information
(ii) Compare each attribute value of the response
(iii) Compare matching with regular expression
POSITIVE (i) Compare the whole response body content with the expected information
(ii) Compare each attribute value of the response
(iii) Compare matching with regular expression
POSITIVE Send valid json in payload/body, as per API document i.e., the request payload is
well-formed (schema validation)
NEGATIVE Send invalid json in payload/body
NEGATIVE Send valid json in payload/body by writing more fields in the payload which are not
expected by database/server
NEGATIVE Send valid json in payload/body by writing less fields in the payload which are not
expected by database/server
POSITIVE (i) Compare the whole response body content with the expected information
(ii) Compare each attribute value of the response
(iii) Compare matching with regular expression
POSITIVE (i) Compare the whole response body content with the expected information
(ii) Compare each attribute value of the response
(iii) Compare matching with regular expression
POSITIVE Send valid json in payload/body, as per API document i.e., the request payload is
well-formed (schema validation)
NEGATIVE Send invalid json in payload/body
NEGATIVE Send valid json in payload/body by writing more fields in the payload which are not
expected by database/server
NEGATIVE Send valid json in payload/body by writing less fields in the payload which are not
expected by database/server
POSITIVE (i) Compare the whole response body content with the expected information
(ii) Compare each attribute value of the response
(iii) Compare matching with regular expression
POSITIVE (i) Compare the whole response body content with the expected information
(ii) Compare each attribute value of the response
(iii) Compare matching with regular expression
POSITIVE (i) Validate data accuracy in response body i.e., the response payload is well-
formed (schema validation)
(ii) Validate HTTP status codes returned
(iii) Validate response time i.e., the API service responds within an expected
timeframe
(iv) Validate error codes in case API returns any errors
LOAD TESTING Developers has to rate limit/time-frame defined of the APIs usage per user/per
access token generated, to improve the application security and performance
THROTTLE TESTING Developers has to rate limit/time-frame defined of the APIs usage per user/per
access token generated, to improve the application security and performance ;
throttling can be applied at user level/minute OR IP-address level/minute
(iv) Ensure that the response headers doesnt reveal server versions or server header
details
(v) Ensure that the response headers doesnt reveal server names
(vi) Ensure that the response headers doesnt reveal the server details in the x-
powered-by field
FUZZ TESTING (i) Validate data accuracy in response body i.e., the response payload is well-
formed (schema validation)
(ii) Validate HTTP status codes returned
(iii) Validate response time i.e., the API service responds within an expected
timeframe
(iv) Validate error codes in case API returns any errors
FUZZ TESTING (i) Validate data accuracy in response body i.e., the response payload is well-
formed (schema validation)
(ii) Validate HTTP status codes returned
(iii) Validate response time i.e., the API service responds within an expected
timeframe
(iv) Validate error codes in case API returns any errors
RESPONSE TIME TESTING Validate response time i.e., the API service responds within an expected timeframe
RESPONSE TIME TESTING Validate response time i.e., the API service responds within an expected timeframe
RESPONSE TIME TESTING Validate response time i.e., the API service responds within an expected timeframe
RESPONSE TIME TESTING Validate response time i.e., the API service responds within an expected timeframe
INPUT TESTING Use the proper HTTP method according to the operation: GET (read), POST
(create), PUT/PATCH (replace/update), and DELETE (to delete a record), and
respond with '405 - Method Not Allowed' if the requested method isn't appropriate
for the requested resource.
FUZZ TESTING Validate the query parameters for input data range (negative numbers, 0-9)
(INTEGERS)
CONTINUOUS TESTING (i) Validate data accuracy in response body i.e., the response payload is well-
formed (schema validation)
(ii) Validate HTTP status codes returned
(iii) Validate response time i.e., the API service responds within an expected
timeframe
(iv) Validate error codes in case API returns any errors