Day 07 | Test Failures On Submission

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:
Day 07/ 15 days of Postman - for testers : Facing 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:
While submitting collection, getting error as “There was an error in evaluating the test script: TypeError: Cannot read properties of undefined (reading ‘item’)”

I’ve already tried:
Passing $item – not worked

You have a status 200 ok. Therefore I’m assuming that you have an environment\collection variable called collection_uid with your collection id in and its the correct ID for this challenge.

It’s probably the folder or request names not matching so one of the finds are failing, so for that element, its telling you that “item” doesn’t exist.

Check that the folder and request names are exactly as defined in the training.

You should also be able to step through the logic in the test using the JSON response body. Get used to doing this, as it helps you work out what test might be failing and why. A lot of mine were simple spelling differences which were easily rectified.

The first thing you should see is the collection object, and the items should be an array. Like following.