freeCodeCamp - Assignment 3 Postman API Test Automation for Beginners issue

Hi there,

Please can you help me if you do not mind.

I am having an issue in the Assignment 3 Postman API Test Automation for Beginners by freeCodeCamp - Unit 2 - Writing API Test .

When I execute the Get an order by ID scripts Task 1 and Task 2 the scripts passed.

When I execute the verify your work the Get an order by ID scripts Task 1 failed.


Here is the error message.

Task 1: Response is JSON. | TypeError: Cannot read properties of undefined (reading ‘items’)

Please see the screen captures.

Thanks in advance.

When posting code, can you use the preformatted text option in the editor please!

Your screenshots are all blurry and difficult to read.

I suspect that the issue is with the “find” on line 3.

The issue isn’t actually with the items variable, but the function that is being called just before it.

I don’t think that pm.collection is a valid pm function. I can’t see it in the list. To get the current collection, you normally have to send a request to the collection API to return a JSON representation of the collection. I’m not aware that you can get direct access to the collection via a PM method.

This might be one that you need to discuss with the developer of the course.