Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to create a new folder in Postman.
Postman
pm.collection.folders.[1]('New Folder');
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'add' instead of 'create' which is not a valid method here.
Using 'new' or 'make' which are not Postman folder methods.
✗ Incorrect
The create method is used to add a new folder in a Postman collection.
2fill in blank
mediumComplete the code to access the name of a folder in Postman.
Postman
let folderName = pm.collection.folders.get('123').[1];
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'id' which is the folder's identifier, not its name.
Using 'title' or 'label' which are not standard folder properties.
✗ Incorrect
The name property holds the folder's name in Postman collections.
3fill in blank
hardFix the error in the code to list all folders in a collection.
Postman
pm.collection.folders.[1](folder => console.log(folder.name)); Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'map' which returns a new array but does not just perform an action.
Using 'filter' which selects items but does not iterate for side effects.
Using 'reduce' which combines items into a single value.
✗ Incorrect
The forEach method is used to run a function on each folder in the collection.
4fill in blank
hardFill both blanks to create a folder and add a request to it.
Postman
let folder = pm.collection.folders.[1]('API Tests'); folder.[2](pm.request);
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'insert' or 'append' which are not Postman folder methods.
Using 'add' to create a folder which is incorrect.
✗ Incorrect
Use create to make a folder and add to include a request inside it.
5fill in blank
hardFill all three blanks to rename a folder and move a request into it.
Postman
let folder = pm.collection.folders.get('456'); folder.[1] = 'New Folder Name'; pm.collection.requests.[2](pm.request); folder.[3](pm.request.id);
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'update' instead of 'moveRequest' which is not a valid method.
Trying to set 'title' instead of 'name' for renaming.
✗ Incorrect
Set the name property to rename the folder, use add to add a request, and moveRequest to move it inside the folder.