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

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.

Related

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.

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

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

searchSite - responds with a File not found

I'm using the postman extension for chrome and trying to work with the yodlee.com 'searchSite' endpoint. I enter the cobSessionToken and the userSessionToken however I'm not too sure about what to enter in the 'siteSearchString' parameter. It seems like whatever I enter just returns with a
File Not Found
The requested web page was not found on this server. Please use the back button and try again.
Is it usual with the sample test case that you provide with the account to have such error? Every other step seems to be working fine except for this "searchSite."
The 'siteSearchString' is what bank you want to search for. An example search string that should work is 'wells' which should return several results for Wells Fargo.
Instead of using postman, I would recommend using https://developer.yodlee.com/TestDrive which will let you fill in the parameters, provide suggested values for the parameters, and view the json results of the REST request.