Here’s an outline with best practices for making your inquiry.
My question:
I’ve set the OAuth 2.0 in the collection - request were sucessful but still I’m getting an error in the test though body is looking correct
I wouldn’t normally comment on these “training” exercises, as usually it’s just case of going back over the instructions and ensuring you have followed them to the letter. Telling you the answers sort of defeats the main purpose of training.
However, it would appear that the test is looking for a folder called OAuth, where it looks like you may have set the authorization at the collection level instead. Therefore, the line “let oauthfolder” is probably returning a blank, and the test is correctly reporting “undefined”.