Add a test script that gets the value of the rand property in the response JSON and sets it as the value of a variable (at collection or environment scope) named responseData. Hint: You’ll need to Send the request twice after adding your code because it won’t save the value until after the response is received the first time.
I am getting an issue in this. This is my code, where am I probably going wrong?
pm.test(‘Stats include all fields’, function () {
var jsonData = pm.response.json().data;
pm.environment.set(“responseData”, jsonData.rand);
I need one help regarding Student expert skill test.
I have passed the test and after some time (after 2 mins) I again run the test now it is showing " Skill checker incomplete!". but test result (11/11) of Test collection is showing all test pass.
I am very confused what should I do?
after spending lot of time as I am new to Postman, I resolved my problem and Completed all test.
I need to remove " " (Syntax error) from my code.
I also received Postman Student Expert Badge
It was a nice experience to solve the assignment and I will continue the rest of the training.
It’s hard to help out without seeing what you have tried. Have you tried re-reading the instructions about adding the script? There are several forum posts here explaining common troubleshooting for this step. Let us know if you continue to be stuck
I am lost here I passed this thing but when I go to submit it says 10 out of 11 whats up?
{
"welcome": "You're using the Postman Skill Checker! Click Visualize for a more readable view of the response.",
"title": "Skill checker complete!!!",
"intro": "You completed the skill checker! To complete your training, make sure all of your requests are saved, and in the collection on the left of Postman, open the overview > then click **Share collection**. Choose the **Via JSON link** tab and click **Get JSON link** to generate or update your collection link (note that each time you make a change you need to update the link). *[**NOTE**: if the 'Share via JSON link' feature is disabled for your team, to get your public JSON link you will need to 1) **Export** your collection as a JSON file from the three dot menu on your collection, 2) **upload your JSON** text to a public filehosting site like https://www.jsonkeeper.com/ or https://www.npoint.io/]*. Copy the address to your clipboard, then open the final folder in the collection **3. Check Progress** > open the **Test Collection** request, paste your collection link in as the request address, **Send**, and this time open the **Test Results** tab to see the status of your collection. Any failed tests will indicate parts of the collection you still need to complete. Once all of your tests pass—**Save** the request and update and copy your collection JSON link.After all your tests pass, continue with the lessons in Postman Academy to submit your collection and claim your badge (https://academy.postman.com/path/postman-api-fundamentals-student-expert/postman-api-fundamentals-student-expert-certification/1976)",
"done": true,
"skills": [
{
"name": "Changed method",
"hint": "Change the request method to `POST`, `PUT`, or `DELETE`.",
"value": true
},
{
"name": "Sent query parameter",
"hint": "Add `email` as a query param, with your student training email address as the value.",
"value": true
},
{
"name": "Added body data",
"hint": "Add JSON body data including a field `name` with the value as your name.",
"value": true
},
{
"name": "Authorized",
"hint": "Add API Key auth with the Key name `auth_key` and how much you learned from the student expert template (e.g. `loads`, `nothing`, etc) as the value (add to the request header).",
"value": true
},
{
"name": "Set a variable",
"hint": "Add a new variable to the collection, naming it `myCourse` and enter the reason you're learning about APIs as the Current value. (Leave the other var in place.)",
"value": true
},
{
"name": "Added a script",
"hint": "Add a test script that gets the value of the `rand` property in the response JSON and sets it as the value of a variable (at collection or environment scope) named `responseData`. Hint: You'll need to Send the request twice after adding your code because it won't save the value until after the response is received the first time.",
"value": true
}
],
"rand": "Otha"
}
Hey guys, I can’t completed my last step in Postman course, using the Test Script below, could you please, advise? If I run this test without Environment - I’m getting Success, with Environment - fail, screen of it added, thanks!
Task: In this ‘Skill check’ request, add a test script in the Tests tab that gets the value of the rand property in the response JSON and sets it as the value of a collection or environment variable named responseData.