“Tokens": {
“ZToken": "eyJ1c2VySWQiOiAiZmYxMzcyZ",
“PToken": "uKnw7KiaSfueeAzG6nc6mvT"
How can I construct a test to check whether each string isn’t blank or null (test PASS) else (test FAIL).
Do I need to use IF/Else ?
“Tokens": {
“ZToken": "eyJ1c2VySWQiOiAiZmYxMzcyZ",
“PToken": "uKnw7KiaSfueeAzG6nc6mvT"
How can I construct a test to check whether each string isn’t blank or null (test PASS) else (test FAIL).
Do I need to use IF/Else ?
Hi @thingmie
You could try something like;
let jsonData = pm.response.json();
pm.test("Check values", () => {
pm.expect(jsonData.id).to.not.eql(null);
pm.expect(jsonData.category.name).to.not.eql("");
});
Thanks a lot! @w4dd325