Our API endpoint consistently returns a 200 status code. However, we have added additional verification conditions in the verification tab of the API object repository. Occasionally, these verifications fail even when we receive a 200 response code. Unfortunately, I am unable to capture these verification failures in my script.
Here is the code snippet that represents my current method:
Those are the verification snippets which runs when you trigger it manually from the request edit window or call it from a testcase with sendRequestAndVerify.
Using this method you don’t have full control over it from testcase.
It will just mark the step in your testcases as passed of failed.
For a fine grain control you may like to use sendRequest instead and implement any verification needed in the testcase, by accesing the response object various properties, either by using various verification keywords or writting your own assertions.
Start to read here: