Here we are validating 5 types of response in the output.
- Status code
- Headers
- Cookies
- Response time
- Response body
- To test the above validations we have something called "Assertions" in Postman. Assertion is nothing but a validation point. To add this validation we have one library in Postman called "pm".In this, we have so many functions available. By adding some parameters to these functions we can validate the above responses.
Testing Headers:
- We can check static values present in the header.
- We are checking whether the text is present in the header as well as the text assigned to the header.
Testing Cookies:
- Every time, the cookies we get are not constant. So we are using two types of assertions. One is to check whether that cookie is present and another is text present for that cookie.
Testing Response time:
- We are checking whether the API is running in the expected time. we don't know the exact time every time, So we are giving min or max time to validate the time.
Testing Response body:
- Sometimes the response in the body is not static values, it will be dynamic sometimes. So, we are validating only the static values or content in the response body.
validating the Response body in 3 categories.
- Validating the type of values.
- Validating the values assigned.
- Validating JSON Schema.
No comments:
Post a Comment