Day 14: OAuth , 30 days postman challenge for developers

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 so that INITIAL VALUE is the same as CURRENT VALUE .

Details:

This is the solution request:-

This is the github request:-

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

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.

2 Likes

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.

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


one test out of six.

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

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.

Help me in passing the Auth added correctly ?

Hey @jaykant02 :wave:

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.