Skip to content
Advertisement

How to find the length or size of the elements of response array in rest assured

I am new to rest assured. I have tried below code for getting response

JavaScript

This is JSON response

JavaScript

How do I get the length or size of the elements of that array.

Advertisement

Answer

As above comment, the length here is the number of key-value pair in the json object.

For me, you can choose any object in the array to count the number of key-value pair, but if you want to specify the json object with condition, for example moduleid=1005, this code would work for you.

JavaScript
Advertisement