Test Overview
This test sends a POST request with a raw XML body to an API endpoint and verifies that the response status is 200 and the response body contains the expected XML element.
This test sends a POST request with a raw XML body to an API endpoint and verifies that the response status is 200 and the response body contains the expected XML element.
pm.test("Status code is 200", function () { pm.response.to.have.status(200); }); pm.test("Response contains expected XML element", function () { const responseXml = pm.response.text(); pm.expect(responseXml).to.include('<message>Success</message>'); });
| Step | Action | System State | Assertion | Result |
|---|---|---|---|---|
| 1 | Send POST request with raw XML body to the API endpoint | Request sent with Content-Type: application/xml and body: <request><data>Test</data></request> | - | PASS |
| 2 | Receive response from server | Response received with status code 200 and body containing <message>Success</message> | - | PASS |
| 3 | Check that response status code is 200 | Response status code is 200 OK | pm.response.to.have.status(200) | PASS |
| 4 | Verify response body contains <message>Success</message> | Response body includes the XML element <message>Success</message> | pm.expect(responseXml).to.include('<message>Success</message>') | PASS |