Hi @sonujain , Welcome to the community
you can try the below snippet:
var jsonData = pm.response.json();
pm.environment.set("resp", JSON.stringify(jsonData));
//using forEach
_.forEach(jsonData, function(jsonData) {
if(jsonData.return_code===0)
{
pm.test('Result has expected properties', function(){
pm.expect(jsonData).to.have.property('return_code');
pm.expect(jsonData.return_code).to.eql(0);
});
}
else if (jsonData.return_code !== 0)
{
console.error(pm.environment.get('resp'));
}
});