🎯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:

RESPONSE:CODE,200,
RESPONSE:JSON_PATH,NONE,id,'Column 1'
RESPONSE:EXPECTED_VALUE,NONE,1,'Aigneis Ravillas'
RESPONSE:STORE_VALUE,NONE,NONE,NONE

In this example, the framework checks that the response code is 200, and the value at Column 1 is 'Aigneis Ravillas'.

Conclusion

The CSV template streamlines API response validation by allowing testers to define expected outcomes in a structured and clear format. If validation fails, or if there's a need for additional support, users can contact us or create an issue on Git.

Last updated

Was this helpful?