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?