Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to create a new workspace in Postman.
Postman
pm.workspaces.create({ name: [1] }); Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting to use quotes around the workspace name.
Passing a variable name instead of a string.
✗ Incorrect
You need to pass the workspace name as a string inside quotes.
2fill in blank
mediumComplete the code to list all collections in the current workspace.
Postman
pm.collections.list({ workspace: [1] });
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect workspace names like 'current' or 'active'.
Not using quotes around the workspace name.
✗ Incorrect
The default workspace is referenced by the string 'default'.
3fill in blank
hardFix the error in the code to switch to a workspace by its ID.
Postman
pm.workspaces.switch({ id: [1] }); Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Passing the ID as a variable without quotes.
Passing the ID as a number without quotes.
✗ Incorrect
The workspace ID must be a string, so it needs quotes.
4fill in blank
hardFill both blanks to create a new environment in a workspace.
Postman
pm.environments.create({ name: [1], workspace: [2] }); Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using workspace names that don't exist.
Not using quotes around strings.
✗ Incorrect
The environment name is a string like 'Test Environment' and the workspace is 'default'.
5fill in blank
hardFill all three blanks to update a workspace's description and visibility.
Postman
pm.workspaces.update({ id: [1], description: [2], visibility: [3] }); Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using numbers instead of strings for ID.
Using invalid visibility values.
Forgetting quotes around strings.
✗ Incorrect
The workspace ID is a string '12345', description is a string, and visibility is 'private' or 'public'. Here 'private' is correct.