# Getting authorization error on Halfway Test

**URL:** <https://community.postman.com/t/getting-authorization-error-on-halfway-test/59494>\
**Category:** Help Hub\
**Tags:** tests, collections, authentication, api\
**Created:** [April 2, 2024, 12:49pm UTC](https://community.postman.com/t/getting-authorization-error-on-halfway-test/59494 "2024-04-02T12:49:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![spacecraft-archite16](https://avatars.discourse-cdn.com/v4/letter/s/73ab20/32.png) [@spacecraft-archite16](https://community.postman.com/u/spacecraft-archite16)\
**Post date:** [April 2, 2024, 12:49pm UTC](https://community.postman.com/t/getting-authorization-error-on-halfway-test/59494/1 "2024-04-02T12:49:34Z")

</div>

I’m running the Halfway Test and all the tests pass except one. The error message is

**[COLLECTION] Collection level Auth is set to type API Key with header named api-key | AssertionError: expected undefined not to be undefined**

Here is the authorization tab from the collection:

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/b/4/b4040945af3c989a61f5835d172be01bb091cb8d.png)

I’ve tried adding the postmanrulz api-key on both the main collection and the test collection, as well as the No Auth, to no avail. Should I recreate the collection once again or is there a fix that I haven’t been able to find?

---

<div class="post-metadata">

**Author:** ![michaelderekjones](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/michaelderekjones/32/14819_2.png) [@michaelderekjones](https://community.postman.com/u/michaelderekjones)\
**Post date:** [April 2, 2024, 2:56pm UTC](https://community.postman.com/t/getting-authorization-error-on-halfway-test/59494/2 "2024-04-02T14:56:33Z")

</div>

How are you setting the authorization when you add the api-key?

“No Auth” will be incorrect.

What does the instructions tell you to do? (Can you link to the training docs you are using).

---

<div class="post-metadata">

**Author:** ![spacecraft-archite16](https://avatars.discourse-cdn.com/v4/letter/s/73ab20/32.png) [@spacecraft-archite16](https://community.postman.com/u/spacecraft-archite16)\
**Post date:** [April 2, 2024, 3:44pm UTC](https://community.postman.com/t/getting-authorization-error-on-halfway-test/59494/3 "2024-04-02T15:44:53Z")

</div>

Hi Mike, I’m setting the authorization by clicking on the collection and clicking on the authorization tab.

No Auth was what was selected when I created the Postman collection. I only tried changing it because of the failed test.

I’m using the online tutorial.

---

<div class="post-metadata">

**Author:** ![michaelderekjones](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/michaelderekjones/32/14819_2.png) [@michaelderekjones](https://community.postman.com/u/michaelderekjones)\
**Post date:** [April 10, 2024, 12:27pm UTC](https://community.postman.com/t/getting-authorization-error-on-halfway-test/59494/4 "2024-04-10T12:27:09Z")

</div>

Which online tutorial, can you please post the link, and then show a screenshot of where you have currently set the authorization. (On the request or collection)

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/system/32/29796_2.png) [@system](https://community.postman.com/u/system)\
**Post date:** [May 10, 2024, 12:27pm UTC](https://community.postman.com/t/getting-authorization-error-on-halfway-test/59494/5 "2024-05-10T12:27:41Z")

</div>

Closed on May 10, 2024, 12:27pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
