Help to solve test cases student expert


Hello Guys can somebody help me to solve this issue.

You might want to share your public collection or at least show screenshots of your request body and collection variables.

The failures are telling you what is wrong.

The student expert course isn’t meant to catch you out, so its generally good advice to just re-read the instructions carefully.

Troubleshooting is part of the learning.

Hello Mike Actually i tried solving these issues and solved a few but stuck with these 2 issues. I Request you to guide me through this.

https://www.postman.com/joint-operations-technologist-64430276/workspace/postman-api-fundamentals-student-expert-certification/collection/33263547-16d10878-15f2-418f-b36e-71f2f56c7949?action=share&creator=33263547


This is the first failing test.

//** [skillcheck] 5. Used a JSON body with 'actorName' */
pm.test(`5. [skillcheck] Used a JSON body with 'actorName; `, function () {
    const b = JSON.parse(req7.request.body.raw)
    pm.expect(b).to.have.property("actorName");
});

Req7 is the “skill check”.

It’s expecting a JSON body, where you have used a query parameter.

You’ve used a JSON body for the “add books” request, so use that for a reference.

This is the second failing test.

// ** [skillcheck] 6. Set "favoriteActor" as a collection variable using pm.collectionVariables.set(...) in  Tests tab script */
pm.test(`6. [skillcheck] Set "favoriteActor" as a collection variable using pm.collectionVariables set(...) in  Tests tab script`, function () {
    const studentScript = req7.event.filter(s => s.listen === 'test')[0].script.exec.join("\n")
    const pattern = /pm\.collectionVariables\.set\(["'`]favou?riteActor["'`]/
    pm.expect(studentScript).to.match(pattern);
});

This is checking that you’ve set a collection variable called favouriteActor in the tests tab of the same skill test request.

You don’t have any code in the tests tab, so this is also failing.

Both of these test failures should have been resolved by carefully re-reading the instructions.

Thankyou so much ! I resolved my testcases.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.