API Response Validation
Validation Mechanism
The automation framework validates API responses by comparing the actual data returned from an API call against predefined expected values.
CSV Template for Validation
The CSV template used for validation defines the parameters for the API call and the expected results. The template format is as follows:
RESPONSE:CODE - The expected HTTP status code from the API call.
RESPONSE:JSON_PATH - The JSON path within the response body where the expected value is located.
RESPONSE:EXPECTED_VALUE - The exact value expected to be found at the JSON path.
RESPONSE:STORE_VALUE - A flag indicating whether to store the response value for later use, typically set to NONE if not storing.
Example of Validation Setup
Here's how the validation is set up using the template:
In this example, the framework checks that the response code is 200
, and the value at Column 1
is 'Aigneis Ravillas'
.
Conclusion
Last updated
Was this helpful?