Hello,
I’m currently working on some API tests and in general it goes well but at this point I want to add some additional information stored in variables to test name/messages. I run requests in collection mode.
How to use (i.e. global) variables im pm.test name?
I have test like this:
var response = JSON.parse(responseBody)
postman.setGlobalVariable(“toolkit_id”, response.ToolkitId);pm.test(“Toolkit successfully created.”, function () {
pm.response.to.have.status(200);
});
and I want to use it like this:
var response = JSON.parse(responseBody)
postman.setGlobalVariable(“toolkit_id”, response.ToolkitId);pm.test(“Toolkit successfully created with ID: {{toolkit_id}}.”, function () {
pm.response.to.have.status(200);
});
I’ve already read topics like this or this but I still can’t make it works as I want. I will really appreciate any help with my problem.