Posts

How to write automated tests for APIs using Postman

References : http://blog.getpostman.com/2014/03/07/writing-automated-tests-for-apis-using-postman/ Ref. site : GET http://httpbin.org/get Example code : tests["response code is 200"] = responseCode.code === 200; /* pm.test("response status is 200", function () {     pm.response.to.have.status(200); }); */ pm.test("Request was successful", function () {     pm.response.to.be.success; }); tests["body contains origin"] = responseBody.has("origin", "202.84.47.68"); // Response Assertion API in test scripts // pm.response.to.have pm.test("Response Assertions WORK fine", function () {         pm.response.to.have.status("OK"); //pm.response.to.have.status(reason:String)         pm.response.to.have.header("Content-Type", "application/json"); //pm.response.to.have.header(key:String, optionalValue:String)         pm.response.to.have.body();         pm.response.to...
Recent posts