Got this error while changing value for workspace key in headers and changing address to collections link
My workspace is public and collection link is also correct. Any idea on how to solve this?
Hey @smritinahata305,
Firstly, great job! Youâre almost there
Could you post the link to your public workspace, that would certainly help debug the issue?
I had the same error can someone help me? follow my link : https://www.getpostman.com/collections/5227d5174d81997f9f7a
Hi @gallaodev,
It looks like this should be an easy problem to fix. The problem is with the header that you have added in the Test collection request:
There are two issues here:
- There is a typo in the key name: you have called it
woakspace
when it should beworkspace
- Youâve set the value to your collection link, but the exercise says that you should enter your workspace link. For example, mine is:
https://www.postman.com/MY-TEAM-NAME/workspace/MY-WORKSPACE-NAME/overview
If you reformat that header key/value to match this, your test should pass.
Thank you @neilstudd, work now.
I didnât understand that it was necessary to update the get public link, I thought it was automatic, so the key was wrong in the post, I had corrected it but I didnât update it.
I didnât really pay attention to the phrase: Add the URL for your public workspace, tks again.
Dear all,
I am stuck on the same error but I used the proper workspace link. Would you mind checking my collection?
https://www.getpostman.com/collections/05cb069e801461d32ea4
Regards,
@jecorde Welcome to the Community
- Please donât save the workspace as a variable.
Something like this,
Because your Test is validating the URL here.
- For Test collection request, you need to only pass the collection link.
I hope this helps
Please let us know if you still face any issues here
Thank you for your tips. There were useful.
One of the final test is failing and error is:
Published workspace (included in Headers âworkspaceâ param) | AssertionError: expected ââ to have a length above 0 but got 0
//published workspace
pm.test(âPublished workspace (included in Headers âworkspaceâ param)â, () => {
let params=pm.response.json().item[1].item[1].request.header[0];
//console.log(Print for test: ${params}
);
pm.expect(params.value).to.have.length.greaterThan(0);
pm.expect(params.value).to.contain(âpostman.comâ);
pm.expect(params.value).to.contain(â/workspaceâ);
});
Any feedback would be appreciated.
09/22/2021:
Also, can someone send me the sample of the workspace link?
I understand that the test is for:
pm.response.json().item[1].item[1].request.header[0];
So, when I printed: console.log(pm.response.json().item[1]);
{
name: âComplete submissionâ
item: [2]
id: â19f907be-84f4-4b69-899a-fc9c5576c092â
description: "Complete your submission for the Galaxy API Adoption badge using the two requests in this final folder:
This means that item: [1] is not even coming in the response. but I am not sure why?
09/23/2021: I compared the JSON response of my collection and a collection link that i found online and I can see that my collection request does not even send the {workspace} value. If request does not contain workspace info, then it wont give an results.
But my problem is still not solved - what should i pass in workspace header?
@APIWorld Welcome to the community
Please refer the above comment if itâs useful!!
workspace URL should look like below:
From your screenshot I understand that you are saving that as variable {{workspace}}, if so please pass the entire URL instead of using variable here.
Thanks for the reply ! However my issue was bit different.
I had to go to share link, update the link and then ran the URI. It worked.
Itâs the same concept - you should update the Link if you make any changes to your collection
what is my problem friends?
Hei! I have the same problem could you please help me?