Hi,
Since this is a complex json and there are multiple HotelRoomsDetails node within the BlockRoomResult,
I had to use a for loop to capture all the json node count, refer this script,
import groovy.json.JsonSlurper
def response = context.expand( '${BlockRoomFixedBE#Response}')
def slurper = new JsonSlurper()
def result = slurper.parseText(response)
def policyCount = 0
def hotelrcount = result.BlockRoomResult.HotelRoomsDetails.size()-1
log.info hotelrcount
for (j in 0..hotelrcount-1){
policyCount = result.BlockRoomResult.HotelRoomsDetails[j].CancellationPolicies.size()
log.info policyCount
}
Thanks,
Jeshtha