Error when submitting collection

Your question may already have an answer on the community forum. Please search for related topics, and then read through the guidelines before creating a new topic.

Here’s an outline with best practices for making your inquiry.

My question:
Getting this error when submitting my collection for day_01- “There was an error in evaluating the test script: TypeError: Cannot read properties of undefined (reading ‘item’)”

Details (like screenshots):

How I found the problem:

When submitting the collection
I’ve already tried:
Regenerating the API key

Have you updated the “postman_api_key” collection variable for day 01?

You need to ensure your generated API key is in the “current” value.

You will need to do this for every day.

Yes I did update the current value with the Api key. But the error remains.

The error is telling you that it can’t find the API key.

It doesn’t appear to be an issue with the header, so its more likely that the issue is with the collection variable.

Can you share a screenshot of the collection variables? (Redacting the value as appropriate).

You can check this by adding a line at the top of the tests tab for the submission to pull the current value of the collection variable.


Then check the log to ensure its not coming back as “undefined”.

(Remember to remove the line of code after you get it working).

Also check that the variables starts with “PMAK-”

Hi Jones,

I added my postman_api_key here under the current value in Collection varables

Not sure what else to recommend, apart from generating a new API key and trying again.

The other thing to check is the actual request that is being sent in the Console Log.

Check the headers and that the x-api-key is being sent in the request, and that it matches the variable.

I tried regenerating the API and adding it. But still the same thing.

How about the console log. Have a look at what is actually being sent.