Having issue with last part on skill check of check progress part in Student expert collection.
“name”: “Added a script”,
“hint”: “Add a test script that gets the value of the rand
property in the response JSON and sets itas 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”: false
}
],
“rand”: “Juana”
My code in test script was:
pm.test(‘Status code is 200’, function() {
pm.response.to.have.status(200);
});
pm.test(‘Stats include all fields’, function() {
var jsonData = pm.response.json().rand;
pm.environment.set(‘jsonData’, jsonData);
});