Is there any way to test an APIs response data array length?
I'd like to be able to confirm shape of responses in cases where response data values are dynamic.
1 comment
ADMIN
Valeri Hristov
Posted on:26 Aug 2016 11:46
I understand the problem, but unfortunately we cannot offer a solution at this moment. We use JsonPath expressions to "reference" values from the JSON variables, but JsonPath does not seem to support referencing array properties, such as length. Perhaps the best solution, besides providing coded steps, would be to add new operations in the Verification actions that can check Array properties... However, they will not be of help if you want to persist the length in a variable, for example, to see if the HTTP Request returned one more item in its response. We are open for ideas, so don't hesitate to share your opinion about how would you expect this functionality to work.