Day 12: Postman API - FAIL get single collection | TypeError: Cannot read property 'type' of undefined

Hello everyone,

I feel like stuck with Day 12. When I submit the final solution, all tests pass but one -

FAIL
get single collection | TypeError: Cannot read property 'type' of undefined

Can you please help me with coping with it, as after checking it multiple times, I’ve got no idea what to do next.


Thank you

Hi @0zzzerov

You are getting error on this line - pm.expect(response.json().collection.auth.type, ‘check collection authorization’).to.equal(“apikey”)
make sure you have added the Authorization Type in Day 12 collection level and check

2 Likes

Adding Authorization Type to the collection level indeed made the change and all the tests passed. Thank you so much for helping me.

Best

2 Likes

please where do i add this , i have been trying to fix this issue

Welcome to the Postman community and congrats on your first post!

Please make sure you have your Postman api key defined under a variable called “apikey” in your environment or collection variables and the environment is actively selected.