{"result":560,"type":"exception"} response for axs request in jmeter - jmeter

I encounter {"result":560,"type":"exception"} response for axs request in jmeter while designing a script to do a load test for a mendix web application. First I encountered untheorized response on login so i used reg. expression extractor to extract CSRF-TOKEN and then login worked fine. after login and try to submit an application, i got {"result":560,"type":"exception"} response. what might be the issue and how can it be solved?
Response body
Response header
Request body
Request header

The issue is that you're sending an incorrect request. Unfortunately we cannot state what exactly is wrong because we need to see both:
Reference successful request including URL, headers and body from i.e. real browser
The request from JMeter which fails including URL, headers and body
So I can only suggest to use a 3rd-party sniffer tool like Wireshark or Fiddler to capture the requests from the real browser and JMeter and compare them. Request must be exactly the same (apart from dynamic parameters which need to be correlated). Given you send the same request as browser does you should get the same (successful) response
Other things to consider:
Check your server log, it might be the case you will figure out the reason from there like it was in this forum thread
Given you have Arabic characters in the request body ensure to use proper encoding, i.e. UTF-8 is always a good choice

Related

JMeter can't find token in any response

I'm trying to record a script in JMeter. I'm getting a 401 error in the login request. I see that the login request is sending a token to the server and I have to correlate this token however I'm not able to find any token in the response body or response header of any previous request. What should I do?
There are 4 sources where the "token" could come from:
Response body
Response headers (including cookies)
URL (as a result of a redirection), if this is the case you might need to play with Redirect Automatically and Follow Redirects checkboxes in the HTTP Request sampler (or HTTP Request Defaults)
The token can be generated by JavaScript. As per JMeter project main page:
JMeter is not a browser, it works at protocol level. 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 displayed at a time).
so if this is the case - you will have to replicate the logic of the associated JavaScript function(s) using JSR223 PreProcessor

Jmeter response-data giving "malformed request" error

I am doing performance testing of an e-commerce website.
After adding items to the cart it is going to the shipping page
and selecting the shipping address,after that it is proceeding for checkout
In the shipping page,it is giving the following error in the response data
{"status":400,"message":"Malformed request","additional_error":""}
Request is going POST and data as **JSON
How to resolve this error?
We don't know.
It is either a bug in your application or your HTTP Request you're sending with JMeter is really malformed and you need to fix it.
I would recommend capturing the same request to the shipping page originating from the real browser and JMeter using an external sniffer tool like Wireshark or Fiddler. The requests have to be exactly the same (apart from dynamic data which needs to be correlated). Given you send the same request you should receive the same response. Amend your request to 100% match what you see from the browser and the issue should go away.
In the 99% of cases REST requests are failing due to missing Content-Type header with the value of application/json or similar (sometimes charset has to be specified as well). You can add this (and other) headers using HTTP Header Manager

Response Data for "GET Method"

I am creating different HTTP Requests for a site and taking an access token as a variable from Regular Expression Extractor and using it in another HTTP Request.
The Thread group is working fine; i.e. no error in View Results Tree. But Response data is only coming for the Request with POST Method. Nothing is coming for the Request with GET Method and both requests are taking the access token properly.
In some cases you may get response code 200 ok and request still may fail. In case of your get request that seems to be happening.
Check following:
Headers being sent with get request. (Compare request being sent from JMeter and from real browser.)
Add response assertion to get request to be assure the correctness of the response. (Check what response you get for the request made from browser.)
Make sure you have added cookie manager in the test plan.

Can't get authorized response on requests in JMeter, while they have the same CSRF token and sessionID

I'm having trouble with getting my site normally loaded during the performance testing in Apache JMeter. Firstly I recorded the script (by BadBoy), containing authorization and visiting some pages, unavailable without login. Next, I exported it to JMeter, configured Regular Expression Extractor to get the csrftoken from the request right before the authorization request and it looks like it works just fine:
no errors in http-requests
But if to look at the tab "Response data" of every post-authorized request, the content isn't like correctly loaded page, it just starts page with the empty authorization form, i.e. in some way session is new though all the requests have the same session id and csrftoken in Cookie Data and in Set-Cookie (Sample result), appeared in authorization request result.
HTTP Cookie Manager is added.
Did anyone face this trouble?
UPDATE: I've conducted an experiment with transferring cookies from Chrome to Mozilla Firefox, copied 'csrftoken' and 'session id', and - voila! - it worked, I got the same authorized session in two browsers. Still have no idea what's wrong with JMeter
JMeter automatically treats HTTP Response Codes below 400 as successful, it doesn't perform any checks of response body. Most likely your Regular Expression Extractor failed, add a Debug Sampler and double check resulting variable value.
There could be also the following possible reasons:
You might need to send CSRF token in encoded/escaped form so using i.e. __urlEncode() function will be required. Or vice versa.
Application may expect the token in multiple locations, i.e. not only as a form parameter, but as an extra HTTP Header. In that case you will need to pass it via HTTP Header Manager
You might also want to try the new step-by-step debugger for JMeter to get to the bottom of the issue.
This is the default behavior of this token. 1. make sure where these tokens are passed. It might be passed multiple times. Check the header. Generally, "xref-token" is again passed.
It should be in exact format, decode it if required, also remove , or ; or /. You can also use fiddler.
The solution was found after recording a script by Blazemeter plugin in Chrome and further exporting it in '.JMX' format. Adding an HTTP Header Manager like this (with its special fields, of course) to each HTTP Request solved the problem.

Facing issues in Jmeter script for asmx calls

We recorded a business flow with Jmeter. In our script we have some asmx calls. All calls are sending requests in http format.
The recorded asmx requests are not sending any parameters (not possible to do correlation).
But after replay, all asmx calls are failing where we are sending some session values in cookies in our requests in view result tree. But not
Getting those sessions in any of the previous response.
Please help me out to fix it.
Thanks in advance
I believe that the problem is in cookies.
Try adding a HTTP Cookie Manager to your test plan. JMeter should be smart enough to handle cookies for you. If you have any cookies being sent via "Browser-derived Headers" - remove them.
If point 1 doesn't help you should be able to manually extract cookie data from Set-Cookie header via Regular Expression Extractor. Inspect View Results Tree Listener output for any Set-Cookie headers being sent in responses.
Don't forget to "tell" your Regular Expression Extractor to look at Headers response field (it defaults to Body)

Resources