Some value from Postman test undefined

I need to create tests in Postman for running key values for the AI Conversation app. I have created tests where I have used the logic below, where I can see all of the values after a test run except actual_cpid For all values, I have used https://jsonpathfinder.com/

Postman doesn’t show this value in the result. Could you please help me figure out what I have missed? Thank you!

let jsonData = pm.response.json();
let utterance = jsonData.utterance;
let actual_intent = jsonData.intent.name;
let expected_intent = pm.variables.get("intent");
let actual_grammar = jsonData.grammars.speech_grammar;
let actual_cpid = jsonData.dialog_metadata.outgoing_data.data.CALLPURPOSE_ID;
let actual_dnis = jsonData.dialog_metadata.destination_uri;

tests[" ," + utterance + ", " + 
            expected_intent + ", " + 
            actual_intent + ", " + 
            actual_grammar + ", " +
            actual_cpid + ", " +
            actual_dnis + ", " +
            pm.environment.get("dialog_id")
            ] = true;

Thanks!

What are the reasons behind using the older tests object and not the pm.test() with the pm.expect() statements?

I’m new to testing in Postman, it’s a way that has already existed in our team and it works.

To me, it’s strange when people have pm.response.json() and pm.variables.get in the same script and then don’t use pm.test() :grin:

What’s the actual response that you’re trying to assert against?

Can you help with the initial question?

I don’t know what the response body is that you’re testing against? The link you shared isn’t the response.

Sharing that would make it easier for others to help with a solution as they would know the structure of the data.

Thank you for your response, we have figurate out with a colleague where is was an issue.