Capturing Postman requests in a report - api

I was checking on Postman and newman and how to automate the api testing. I have checked on assertions and the report generations that show results of assertion failures and pass status. We can check the status code by writing a an assertion. But is there a way where in we can capture the request and response directly for an api and generate a report that shows (say) 3 apis were tested and the requests agve 200 for first call 201 fro second an d then 400 for third without writing any assertions. The overall result will show request url and corresponding response code for the api.
This will be helpful in a way when we run a collection and then can see a html report stating the response code corresponding to the request url.
Thank you all in advance for your patience reading and extremely helpful insight to the problem. Thank You.

this already exists in Postman, through its command line interface Newman.
Have a look here and here as well.
You'll be able to set options, depending on the kind of reports you want.
Personaly I can use newman in TFS and get JUnit style reports that fit for my continuous integration purpose. You can generate also HTML reports.
Check the different options.
To handle response data, have a look here :
This takes place in the Tests tab of the Postman request, though
You can obtain informations about HTTP code (responseCode.code), description (responseCode.detail), etc.
You can also parse the JSON body to get more information
var jsonData = JSON.parse(responseBody);
You can output this data in the console

Related

Is there an option in karate framework to print the request payload with CURL syntax in the test report

when there are failures in your test report, sometimes you want to test the api with different parameters to see the behaviour. to do that, it will be easy if the test report contains the request with CURL syntax , so that you can just copy and import to postman and hit it in seconds instead of copying URL, headers, body separately.
Currently I use cucumber reports, and only see the request details logged in plain format
Unfortunately this is not an option currently.

Data storage after API call form Postman/SoapUI

I need to create an automated test-setup for some webservies, and plan to use SoapUI or Postman for that. My question is pretty basic. What happnds to the data after a request is made?
E.g. if the response contains data from a system, and display it in the Postman UI, will Postman store the response? Or what will happnd to it after the request?
I'm asking for security purpose and I was not able to find a concrete answer myself. Thank you in advance.
Postman provides us the explicit ways to store data or not. When you try to run a collection then in the settings we can specify if we want to store responses, cookies, etc or not. Configure it as per your need.
As per the official site
"Postman does not track any content of your requests/responses."
Under File--> settings
You can even avoid using the cloud version if you don't want to sync up things
Re SoapUI...
If you call a service once, then the data remains in the UI. If you run a second or third time, then only the last response is shown in he UI.
Once you close SoapUI, the request and response data is gone.
However, you can save the data from every request and response by using a datasink step, should that be what you want.

How to get csrf token in Jmeter to use for log-in

I'm trying a log-in scenario for a page, but it's getting an error because of the csrf_token and other dynamic parameters that are being generated every time I run the test. How do I get these csrf_token and these parameters to use in my test?
Please see image below.
Request Header parameters
Jmeter Parameters
Error detail
Thanks,
You need to extract it from the previous response using a suitable Post-Processor, store it into a JMeter Variable and replace the recorded value with the variable.
The process is known as "correlation" and there is a lot of information on the topic over the web, for example How to Load Test CSRF-Protected Web Sites article would be a good starting point.

Katalon - Verifying form data by checking the network request

I am using a Katalon tool + groovy scripts for UI automation.
The page I would like to test has a number of filter fields of a different types (text fields, date pickers, etc.) and submit button that sends the request to the server.
I wasn't able to find any relevant information for the following issue:
is it possible to get the request that was sent by the browser to the server in order to parse and verify the parameters values?
Thanks in advance,
IM
I think you have to distinguish between UI and API Testing. For UI-Test you have to check the behaviour of UI and the correctness of all elements that are displayed.
With API Testing you can verify that your request are receiving correct status codes and responses for different sent form data.
For API Testing see https://docs.katalon.com/katalon-studio/tutorials/introduction_api_testing.html#what-is-api-testing

best way to test form submitting

I have a form that posts to an external url
<form method="post" action="http://api.domain.com/AddAnswer">
and I'm using MongoHQ to "dump" the result of that form
I wanted to make a simple test to submit 100 forms just to see if I get 100 answers in MongoHQ
Is there any available services out there for such, or I need to create my own auto-submitting?
Blitz.io only work with GET's, and I was thinking as well that would be nice to test the browser as well, as Chrome always get the Origin error as form host and form action are in different servers (even though the form is submitted correctly).
If no service available for such scenario, how would you proceded?
I was thinking in creating a HTML page and hosted somewhere, then open a Windows/Web page that I would hit that url 100 times.
I could easily add
$(function() {
var dt = new Date();
// set date so we can have different posts data
$("#dt").val(dt.getTime());
// auto submit
$("form").submit();
});
to the static page...
If I get your idea correct, you want to execute 100 post requests and then to verify that the response is correct.
If I am right, I can suggest you http://www.soapui.org/ . It is pretty simple to create that kind of test cases by following the tutorials they provide. Basically in your case you just need to develop a test which execute the request and verify the response content (if just waiting for response code 200 is not enough for you). Then you need to develop load test which call your verification test N-time. And that’s all. As a result you will have test case which verify that you have N right responses.