Katalon - Verifying form data by checking the network request - api

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

Related

In Jmeter, I am not passing one value in request body but that value showing in response

In Jmeter, I am not passing one value in request body but that value showing in response. When I pass different value in script that time also any values not showing in response.if you are provide solutions that would be great.
PS: Application options are full of drop down boxes. In Default some values are selected
Would be great if you show how did you "pass" the value and how exactly it's "showing" in the response.
JMeter doesn't know anything about drop-down boxes, it sends a HTTP request, waits for the response and measures the time in between.
You can use your browser developer tools to see how various values in the drop-down boxes are reflected in the generated HTTP request parameters or record the requests(s) you need to simulate using JMeter's HTTP(S) Test Script Recorder or JMeter Chrome Extension.
The fact that the value is "showing" in response doesn't necessary mean that it's visible to the end user because it might be hidden by CSS.

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.

Capturing Postman requests in a report

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

How to check in jmeter if entered fields remain same in the first page after navigating back from nth page

I want to test a page.Where i want to fill up the fields like first name last name etc.and after going two pages further if i come back to the original page by using back navigation ,data entered for first name and last name remains the same.or it is filled up.
In jmeter i want to check the same if data entered for the fields remain same if i navigate back .
How can i achieve this.
I tried gving url directly in the path its not happening since it is not the way.
please help me since i'm new to jmeter.
You need to understand 2 things. How JMeter works and how your application works.
JMeter only captures data that is communicated to server. It does not matter how data is entered from UI. It does not check if data retains in the fields or not. It only records the request that is sent by your application to server-side.
So, if you understand above, you also need to understand how your application sends data to server. Does it sends the request as you move from first page to second. Or does it send (Submit) data on final page.
Either way, JMeter is not a tool to test if your form fields are retaining data in them as you navigate between pages. As mentioned earlier it only monitors data requests/responses.
Selenium seems a better option for your test requirement.
Please read the apache documentation carefully:
JMeter is not a browser. As far as web-services and remote services are concerned, JMeter looks like a browser (or rather, multiple browsers); however JMeter does not perform all the actions supported by browsers. In particular, JMeter does not execute the Javascript found in HTML pages. Nor does it render the HTML pages as a browser does (it's possible to view the response as HTML etc., but the timings are not included in any samples, and only one sample in one thread is ever viewed at a time).
First, you have to understand how JMeter works!!! To do the Functional Testing, Selenium would be a good choice.
Thanks

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.