Forum Discussion
raptor
7 years agoOccasional Contributor
I think see 100 photos.
The response I got contains 100 photos I think. I have attached it in a text file.
I validated it by pasting it here and then clicking on 'Viewer'.
nmrao
7 years agoCommunity Hero
Based on the attachment which is json, here is the Script Assertion:
//Check if there is response assert context.response, 'Response is empty or null' def json = new groovy.json.JsonSlurper().parseText(context.response) def actualPhotos = json.photos.photo.size() //log the photo instances log.info actualPhotos def expectedPhotos = 100 assert expectedPhotos == actualPhotos