I want to access environmental variables in tests. For ex. check if values are signed to the correct fields.
I've tried to get variable values different way and the only one working is to set a variable inside the test but then I won't be able to edit it in bulk to run tests with other presets.
pm.test("Check if caregiver information is correct", function () {
pm.expect(jsonData.caregivers[0].first_name).to.equal("{{caregiverName}}");
});
code above returns AssertionError: expected 'adam' to equal '{{caregiverName}}'
console.log(pm.variables.get("{{caregiverName}}"));
returns null
console.log("{{caregiverName}}");
returns {{caregiverName}}
I would expect the value of {{caregiverName}}
to equal what I have set as in environmental variables.