0
0
Postmantesting~10 mins

Why visual workflows simplify complex testing in Postman - Test Your Understanding

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to start a new Postman collection run.

Postman
pm.collection.run({ [1]: '{{collectionId}}' });
Drag options to blanks, or click blank then click option'
AcollectionId
Bstart
Cexecute
DrunCollection
Attempts:
3 left
💡 Hint
Common Mistakes
Using method names instead of collection identifier.
2fill in blank
medium

Complete the code to add a test script that checks response status is 200.

Postman
pm.test('Status code is 200', function () { pm.response.to.have.status([1]); });
Drag options to blanks, or click blank then click option'
A201
B200
C404
D500
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong status codes like 404 or 500.
3fill in blank
hard

Fix the error in the test script to correctly check if response body contains 'success'.

Postman
pm.test('Body contains success', function () { pm.expect(pm.response.text()).to.[1]('success'); });
Drag options to blanks, or click blank then click option'
Acontain
Bcontains
Cincludes
Dinclude
Attempts:
3 left
💡 Hint
Common Mistakes
Using singular or incorrect method names causing errors.
4fill in blank
hard

Fill both blanks to create a visual workflow that runs tests only if response status is 200.

Postman
if (pm.response.status === [1]) { pm.test('Run tests', function () { pm.expect(pm.response.[2]).to.be.ok; }); }
Drag options to blanks, or click blank then click option'
A200
Bjson
Ctext
D404
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong status codes or response properties.
5fill in blank
hard

Fill all three blanks to create a test that checks if response JSON has a key 'status' with value 'success'.

Postman
pm.test('Status key is success', function () { const jsonData = pm.response.[1](); pm.expect(jsonData.[2]).to.eql([3]); });
Drag options to blanks, or click blank then click option'
Ajson
Bstatus
C'success'
Dtext
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'text' instead of 'json', wrong key names, or missing quotes around string.