Inside of an api test, i would like to get data from another api to compare against. ex;
Send GET request to abc.com/user
- In the test section -
jsonData = pm.response.json()
pm.globals.set(“user”, jsonData.user)
pm.test(“User data is valid”, function () {
const getData ={
url: www.123.com/user,
method: ‘GET’,
header: {{ header}}
};
pm.sendRequest(getData);
jsonRes = pm.response.json()
pm.globals.set(“user2”, jsonRes.user)
pm.expect(user2).to.equal(user);
});
Even though i get a 200 on the call, the response, when logged, is not properly stored. Am i doing something wrong here?