Scratching head - Just want to display value of variable on Test Results using new pm

Hi,

I want to display the value of my Account variable on the Test Results tab.
I was able to do this with this statement:
tests[postman.getGlobalVariable(“Account”)] = true;

I can’t seem to figure out how to write the same thing using the new set of test APIs (pm.)

Thanks,
Anne

@anne.demata

Did you try this ?

tests[pm.globals.get(“Account”)] = true;

Have you tried something like:

pm.test(pm.globals.get("Account"), function () {
    // your tests here
});

or

pm.test(`Test - ${pm.globals.get("Account")}`, function () {
    // your tests here
});

Thank you, dhoyt and vdespa!!! And sorry I was not able to reply sooner.

I ended up using this format: pm.test(Test - ${pm.globals.get("Account")}, function () {
// your tests here
});

If I just want to display the value without any additional tests, I put a true condition under //your tests here. Something like 1 === 1; :smiley: