How to validate the message inside the errors

I tried to get by this way but getting undefined:

var res = pm.response.json();
pm.test('Verify message for Login with empty password ', ()=>{
pm.expect(res.errors.message)“should NOT be shorter than 8 characters”);

Hey @NitiJabin

It looks like errors is an array, so you would need to reference an object inside it.

res.errors[0].message would be what you need to get the first object.