I have recently started using postman for API automation. But I am seeing a default test case getting added to postman even I have not mentioned any test case explicitly. Whenever API Request is successful, it shows "PASS : No Errors in response" in Test results. But I did not have any test case in tests section.
So could you please help me to understand where it is coming from?
Thanks in advance.
Related
I am working on a sample MEAN application where in I have started to create the node.js related files and connected the same to MongoDB. I have create a POST call which sends the json to the DB. I tried to test the api using postman but not sure whats wrong, I have checked multiple times, the api throws bad request.Any help on this is much appreciated. Thanks.
Added the relevant route.js, app.js and contact.js files for reference in stackblitz link. Added error in postman for reference.
https://stackblitz.com/edit/node-mlodls?file=app.js
Resolved the issue using postman extension. Wondering why the API doesnt work in postman software and works in postman extension
I am getting familiar with both Postman and SoapUI. I already have a doubt. When I make a GET call with from the postman-echo service, I get slightly different responses shown to me in Postman and in SoapUI.
In particular, in Postman I get
"postman-token": "1ef2b330-3a46-4681-a304-d72f020cb194"
This field-value pair is not shown by SoapUI.
Can anyone explain me the apparent difference?
The parameter postman-token being added while you send a request from Postman. So, it's a custom parameter, you cannot expect it to be present with other tools.
If you check Postman doc of General settings They have explained what is that param is for:
This is primarily used to bypass a bug in Chrome. If an XmlHttpRequest
is pending and another request is sent with the same parameters then
Chrome returns the same response for both of them. Sending a random
token avoids this issue. This can also help you distinguish between
request on the server side.
You can disable it from Postman settings. Goto Settings > General > Send Postman Token header.
We are currently facing an issue wherein our postman collection is no longer responding with sample data created. We have made no changes to the collection and have been using the collection as a way to architect our front-end application to an API contract.
Originally, this was working fine. However, we are now being returned the following error:
{
"error": {
"name": "inactiveMockError",
"message": "Mock has been inactived due to an invalid
environment. Please try to recreate your mock with the
desired collection and environment (optional)."
}
}
I've tried recreating the mock by duplicating the collection, but to no avail. This error message is not referenced in the postman documentation. Has anyone encountered this issue? And has anyone found a solution that works?
Thank you, in advance.
The mock got de-activated because of the environment being used by it got deleted. You can create a new mock on that same collection and use the new mock url that is generated.
I am using the Postman Collection Runner to run the same request multiple times using iterations. My tests work as expected, but I'm not able to see the individual responses for each request.
Is it possible to view the responses for requests in the Postman Collection Runner?
In the latest version of Postman you can see all the data from the collection run for each individual request.
In the Collection Runner, Click on the request name and all the details of the request and response can be viewed.
More information can be going on the Debugging using the Request & Response body section of this page
This might help somebody, I tried
pm.test(responseBody, true)
and this printed the response in run summary.
Let me add more details about the shadowcharly solution.
Your results may be viewed if you assign responseBody variable to tests array (in Tests tab)
tests["body"] = responseBody
and export it as json (on the interface you only see the zero/one results if test passed or not).
It's not very useful but this is the only way I've found.
If you are repeating exactly the same query, you could use the test name to show the result:
tests['Test to see value of key Key'+ keyValue] = testResult....
You will have a different test for each value received, not exactly a log, but works fantastic ;)
I know this is old, but postman has added a feature in the collection runner.
Recently, I'm running an JBehave demo for the Web Service API test. During the example, it calls the Google Shorten URL service. After the execution, i noticed that errors throws:
java.lang.AssertionError: id
Expected: aaa
got: bbb
That's interesting for me, coz indeed i verified that both works. So the second one, i manually got from https://goo.gl/, and the first one, i guess the code calling the Google Shorten URL service directly. So, could anybody shed some light what's going on here? i searched but no clue yet. Thanks all!