30DaysPostmanDeveloper: Day 02 - There was an error in evaluating the test script: TypeError: Cannot read property 'item' of undefined

Getting this error while submitting the Request.

There was an error in evaluating the test script: TypeError: Cannot read property ‘item’ of undefined

Updated the environment properties with collection_uid, postman_api_key

It looks like the request returned a 404 response, given that information, the script wouldn’t complete as it’s looking for something in the response body.

I would check that the URL, path, ids etc are correctly resolved. You can see the full request that was sent by opening the Console.

I agree with Danny - I can replicate this problem if my collection_uid variable is set incorrectly (e.g. if it’s accidentally retaining the collection ID from your Day 1 solution). You mentioned that you’d set this as an environment variable - you won’t want to do this, because every day’s solution requires a different collection_uid value.

1 Like

I tried everything. I removed the environment variables.
I added directly to the request.
Collection ID is new one. Generated today. Still an error.

Is that the request ID in the URL or the Collection ID - I can’t see the full URL but it looks nearly the same as the one in the right side request context menu. :thinking:

Ensure it’s the Collection ID in the path and than there are no additional characters on the end of the value, sometimes that happens.

1 Like

Added full screenshot with Request with Collection ID:
No extra or additional characters found in console.

You’re adding the request ID and not the Collection ID.

1 Like

This has confirmed what Danny suggested :slight_smile: The ID that you have directly added to the request is the Request ID, not the Collection ID. (You will see that in the right-hand panel, the panel is titled “Request details”)

You can find the collection ID by clicking on the “Day 02: Collections and environments” label in the left panel, and then if you click the highlighted “Info” link it will reveal the Collection ID value.


Finally found the details.

I missed to see the heading “Collection Details” / “Request Details”


1 Like

I too see the same type of error even when I have added the collection id

Need some help on this.

My bad , I was able to figure out the issue , I had to remove the flower bracers.