# Day 14: OAuth , 30 days postman challenge for developers

**URL:** <https://community.postman.com/t/day-14-oauth-30-days-postman-challenge-for-developers/25375>\
**Category:** Help Hub\
**Created:** [July 1, 2021, 5:35am UTC](https://community.postman.com/t/day-14-oauth-30-days-postman-challenge-for-developers/25375 "2021-07-01T05:35:00Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![harshi1037](https://avatars.discourse-cdn.com/v4/letter/h/bc79bd/32.png) [@harshi1037](https://community.postman.com/u/harshi1037)\
**Post date:** [July 1, 2021, 5:35am UTC](https://community.postman.com/t/day-14-oauth-30-days-postman-challenge-for-developers/25375/1 "2021-07-01T05:35:00Z")

</div>

_My question_:  
Unable to clear this test in 30 days of Postman challenge, Day 14 OAuth. I’m new to postman and all suggestions are welcome.

> Scripts added correctly | AssertionError: check collection variable set: expected ‘pm.test(“Status code is 200”, function () {\r, pm.response.to.have.status(200);\r,});’ to include 'pm.collectionVariables.set

This is the task:

> 1. **Add a test and script** :
> 
> - Add a Postman test to ensure a successful `200` response
> - Add a script to determine how many repositories are returned in the response. Save this number as a collection variable called `repoCount` . Confirm the script is storing this data properly and [persist the data](https://learning.postman.com/docs/sending-requests/variables/#sharing-and-persisting-data) so that `INITIAL VALUE` is the same as `CURRENT VALUE` .

_Details_:

This is the solution request:-

 ![image](https://us1.discourse-cdn.com/getpostman/original/2X/8/8cfddeba9ad02dff89e37054a8ccfcc7c8179349.png)

This is the github request:-

 ![image](https://us1.discourse-cdn.com/getpostman/original/2X/5/5d8968f39fdeb8834cbbb47cd7e79812226eec15.png)

 ![image](https://us1.discourse-cdn.com/getpostman/original/2X/e/e1a980562cff9246dc18f72295eb766946449b18.png)

_I’ve already tried_:  
I’ve tried adding collection variable set , on both pre request script and test but nothings seems to be working.

---

<div class="post-metadata">

**Author:** ![neilstudd](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/neilstudd/32/8213_2.png) [@neilstudd](https://community.postman.com/u/neilstudd)\
**Post date:** [July 1, 2021, 8:45am UTC](https://community.postman.com/t/day-14-oauth-30-days-postman-challenge-for-developers/25375/2 "2021-07-01T08:45:26Z")

</div>

Hi @harshi1037,

The screenshots of your tests look good to me. However, the message in the “Submit your solution” tests seems to indicate that it’s not found your entire script - notice how the text in the test failure after ‘expected:’ does not contain all of your test?

I think the solution may be quite simple. In your final screenshot, the ‘Save’ button is illuminated, which suggests to me that you have unsaved changes in your tests. The “Submit your solution” tests will only be able to access your most recently-saved changes (as it accesses the data via the Postman API).

So, if you click “Save” in your github request, and re-run the tests, hopefully it should now pass.

---

<div class="post-metadata">

**Author:** ![harshi1037](https://avatars.discourse-cdn.com/v4/letter/h/bc79bd/32.png) [@harshi1037](https://community.postman.com/u/harshi1037)\
**Post date:** [July 1, 2021, 9:35am UTC](https://community.postman.com/t/day-14-oauth-30-days-postman-challenge-for-developers/25375/3 "2021-07-01T09:35:26Z")

</div>

Thanks a ton @neilstudd !  
The test passed. And I also realized my changes weren’t saved after I closed the postman tab of my browser. I will definitely keep this in mind from next time.

---

<div class="post-metadata">

**Author:** ![daminimehra](https://avatars.discourse-cdn.com/v4/letter/d/7bcc69/32.png) [@daminimehra](https://community.postman.com/u/daminimehra)\
**Post date:** [January 6, 2022, 4:23pm UTC](https://community.postman.com/t/day-14-oauth-30-days-postman-challenge-for-developers/25375/4 "2022-01-06T16:23:04Z")

</div>

hey @neilstudd ! I am also attempting this challenge and I am getting failed

 ![Screenshot (680)](https://us1.discourse-cdn.com/getpostman/original/3X/3/c/3cf7fa7c7c08be9093e71059277bb70d6c167258.png)  
one test out of six.

---

<div class="post-metadata">

**Author:** ![mission-observer-985](https://avatars.discourse-cdn.com/v4/letter/m/b2d939/32.png) [@mission-observer-985](https://community.postman.com/u/mission-observer-985)\
**Post date:** [February 15, 2022, 8:51am UTC](https://community.postman.com/t/day-14-oauth-30-days-postman-challenge-for-developers/25375/5 "2022-02-15T08:51:21Z")

</div>

@daminimehra I have the same problem as you. I have public repost, but i cannot see them here. Maybe @neilstudd can help.

---

<div class="post-metadata">

**Author:** ![spaceflight-archite8](https://avatars.discourse-cdn.com/v4/letter/s/6f9a4e/32.png) [@spaceflight-archite8](https://community.postman.com/u/spaceflight-archite8)\
**Post date:** [January 7, 2023, 3:03pm UTC](https://community.postman.com/t/day-14-oauth-30-days-postman-challenge-for-developers/25375/6 "2023-01-07T15:03:06Z")

</div>

If you look for that error message in the submit test script you can get a better idea why it fails.

In this case, it is looking for a collection variable named ‘repoCount’. Check your code that sets this variable.

---

<div class="post-metadata">

**Author:** ![jaykant02](https://avatars.discourse-cdn.com/v4/letter/j/87869e/32.png) [@jaykant02](https://community.postman.com/u/jaykant02)\
**Post date:** [April 21, 2024, 11:52am UTC](https://community.postman.com/t/day-14-oauth-30-days-postman-challenge-for-developers/25375/7 "2024-04-21T11:52:58Z")

</div>

Help me in passing the Auth added correctly ?

---

<div class="post-metadata">

**Author:** ![danny-dainton](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/danny-dainton/32/29401_2.png) [@danny-dainton](https://community.postman.com/u/danny-dainton)\
**Post date:** [April 21, 2024, 12:00pm UTC](https://community.postman.com/t/day-14-oauth-30-days-postman-challenge-for-developers/25375/8 "2024-04-21T12:00:59Z")

</div>

Hey @jaykant02 👋

Can you please create a new topic which  
shows what you have done so far.

Including the full public Workspace URL will help others to see the problem.
