Extract value from a JSON Response Body via the Test Scripts

Hi @test.vtw welcome to the community :partying_face:

Please read the similar post discussed here.

You should be using the bracket notation instead of dot notation.

For example,

let response=pm.response.json();
console.log(response);
pm.environment.set("camtest1", response['cam:test']);
pm.environment.set("camtest2", response['cam:test2']);

This is just based on the response you have provided above, please edit the path if needed :blush: I hope this helps!

2 Likes