Which statement best describes the idempotency property of a PUT request in REST API testing?
Think about what happens if you send the same update multiple times.
PUT requests are idempotent, meaning sending the same request multiple times results in the same state as sending it once.
Given this Postman test script for a PUT request, what will be the test result?
pm.test('Status code is 200', function () { pm.response.to.have.status(200); }); pm.test('Response body has updated name', function () { var jsonData = pm.response.json(); pm.expect(jsonData.name).to.eql('Alice'); });
Check what each test is verifying in the response.
The first test checks the HTTP status code is 200. The second test checks the JSON response has the updated name 'Alice'. Both must be true to pass.
In Postman test scripts, which is the best way to access the 'email' field from a JSON response after a PUT request?
Consider how to parse JSON response in Postman scripts.
pm.response.json() parses the response body as JSON, allowing direct access to fields like 'email'.
Which Postman test assertion correctly verifies the PUT response has status 204 and an empty body?
Think about how to check an empty response body as text.
pm.response.text() returns the response body as a string. For empty body, it should equal an empty string ''.
You want to run a Postman collection with PUT request tests automatically in your CI pipeline using Newman. Which command correctly runs the collection and outputs a JSON report?
Check Newman documentation for JSON reporter options.
The correct Newman command uses '-r json' to specify JSON reporter and '--reporter-json-export' to set output file.