0

I am getting dependency error on Postman after successfully passed all tests in Postman Student submit training.

{"status":"error","message":"Your collection failed one or more Postman tests. See the errors array for details.","errors":[{"test":"6. [skillcheck] Set "favoriteActor" as a collection variable using pm.collectionVariables set(...) in Tests tab script","message":"expected 'const id = pm.response.json().id\npm.collectionVariables.set("actorName", id)' to match /pm\.collectionVariables\.set\(["']favoriteActor[\"']/"}]}

enter image description here I am expecting this result

2 Answers2

1

Try this solution will work with you; I had the same issue and received the confirmation message after writing this code in the test tab:

const actorName = pm.response.json().data.actorName
pm.collectionVariables.set("favoriteActor", actorName)
Jeremy Caney
  • 7,102
  • 69
  • 48
  • 77
0

I used this code and it passed me the test. Hope it works for you too

const actorName = pm.response.json().actorName

pm.collectionVariables.set("favoriteActor", actorName)

  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Mar 31 '23 at 00:15