Error in submissions of Postman API Fundamentals Student Expert certification

I’m submitting the postman examples, however, errors returned in the ā€˜Add a book’ request. However, the errors are referencing what I believe is a request that includes parameters - movies in the request which is not part of ā€˜adding a book’.


{
ā€œstatusā€: ā€œerrorā€,
ā€œmessageā€: ā€œYour collection failed one or more Postman tests. See the errors array for details.ā€,
ā€œerrorsā€: [
{
ā€œtestā€: ā€œ[add a book] has script in Tests tabā€,
ā€œmessageā€: ā€œCannot read properties of undefined (reading ā€˜length’)ā€
},
{
ā€œtestā€: ā€œ1. [skillcheck] Used POST as the request methodā€,
ā€œmessageā€: ā€œCannot read properties of undefined (reading ā€˜request’)ā€
},
{
ā€œtestā€: ā€œ2. [skillcheck] Used a query parameter called ā€˜movieNameā€™ā€,
ā€œmessageā€: ā€œCannot read properties of undefined (reading ā€˜request’)ā€
},
{
ā€œtestā€: ā€œ3. [skillcheck] Used a base URL variable called {{skillcheckBaseUrl}}ā€,
ā€œmessageā€: ā€œCannot read properties of undefined (reading ā€˜request’)ā€
},
{
ā€œtestā€: ā€œ4. [skillcheck] Set request auth to ā€œAPI keyā€ & header to ā€œstudent-expert"ā€,
ā€œmessageā€: ā€œCannot read properties of undefined (reading ā€˜request’)ā€
},
{
ā€œtestā€: "5. [skillcheck] Used a JSON body with 'actorName; ",
ā€œmessageā€: ā€œCannot read properties of undefined (reading ā€˜request’)ā€
},
{
ā€œtestā€: ā€œ6. [skillcheck] Set "favoriteActor" as a collection variable using pm.collectionVariables set(…) in Tests tab scriptā€,
ā€œmessageā€: ā€œCannot read properties of undefined (reading ā€˜event’)ā€
}
]
}

This means it can’t read the response. All of the errors are likely to be related to the same issue.

Check the response for the submit request. It should return your collection as JSON.

I suspect its failing the authentication, or something similar.

Yes, I know it cannot read the response. However, when I submit the same request, I get a successful 201 response. See below the response:

{
ā€œidā€: ā€œf976323b-5f38-47e4-92ff-7efed38739b4ā€,
ā€œtitleā€: ā€œTo Kill a Mockingbirdā€,
ā€œauthorā€: ā€œHarper Leeā€,
ā€œgenreā€: ā€œfictionā€,
ā€œyearPublishedā€: 1960,
ā€œcheckedOutā€: false,
ā€œisPermanentCollectionā€: false,
ā€œcreatedAtā€: ā€œ2023-07-05T19:08:01.570Zā€
}

However, when I submit it back as part of the submission for certification, I get an error. But the errors are the thing that confused me.

ā€œtestā€: ā€œ2. [skillcheck] Used a query parameter called ā€˜movieNameā€™ā€,
ā€œmessageā€: ā€œCannot read properties of undefined (reading ā€˜request’)ā€

Talks about a query parameter - ā€˜movieName’ which is not part of the request. See below:

Request Headers

Content-Type: application/json

api-key: postmanrulz

User-Agent: PostmanRuntime/7.32.3

Accept: /

Cache-Control: no-cache

Postman-Token: 5d2323ea-f429-4557-b0d6-60ebae8eb574

Host: library-api.postmanlabs.com

Accept-Encoding: gzip, deflate, br

Connection: keep-alive

:arrow_forward:Request Body

{ ā€œtitleā€: ā€œTo Kill a Mockingbirdā€, ā€œauthorā€: ā€œHarper Leeā€, ā€œgenreā€: ā€œfictionā€, ā€œyearPublishedā€: 1960 }

I don’t have access to this course, so I don’t know what it asks.

I’m not even sure if its the same format as the other training courses. (I understand this course was updated recently).

With the other courses, you have a bunch of individual requests that you have to create or amend.

With a separate sub-folder with the submit request.

It doesn’t matter if the individual requests are passing.

It’s the submit request, which should be returning a JSON response of the entire collection details.

The submit request has a bunch of tests in the tests tab that assert on elements within that collection JSON.

I can’t comment on the movieName parameter as I can’t see the course details but the errors are all coming back as undefined which usually means it can’t read the response at all (or its not in the expected format). So my recommendation would be to fix that bit first.

The first step is to check is whether the collection is actually being returned. That you are not getting authentication errors (401) which is the usual suspect here related to how the API key has been added.

Hi,
I’ve resolved the issue - user error. Failing to read the section that describes skill checks which includes movieName.