Test script using main body data

The following should work.

const requestJson = JSON.parse(pm.request.body.raw);
const responseJson = pm.response.json()

let employeeID = responseJson[0].Employee_ID;

pm.test(`expect employee id to equal ${requestJson.id}`, () => {
    pm.expect(employeeID).to.eql(requestJson.id);
})

1 Like