View Result tree is not showing a correct request as in script - jmeter

In the script we are using a PUT request as shown in below image
But when we run this, it is showing it as a GET request as shown in the below image
Due to this request is failing with a 400 bad request response code.
I am using Jmeter 5.5

If you expand this Sample Result to see its sub results you will see your initial PUT request followed by at least one redirect so View Results Tree listener is "showing the correct result", the fact that your PUT request fails is rather connected with a problem in your script, most probably you're simply not authorized due to missing or improperly implemented correlation or something like this.
So visit previous results and inspect their response data to ensure that your script is doing what is supposed to be doing, the fact that the request is "green" indicates only that HTTP Status Code is below 400, it doesn't necessarily mean that it's successful.

Related

JMeter View results tree listener displaying duplicate https requests

View result listener displaying duplicate https requests, 1 request is without response and 1 request is with having response. I need only 1 request, How can i fix it?
enter image description here
enter image description here
Sample with response message as "Number of samples in transaction : 1, number of failing samples : 0" is for the "Transaction Controller" while the other is the actual request with response.
Select the "Generate parent sample" checkbox in the Transaction controller and you will be able to see the desired results.
Transaction Controller will always club the response times for the underlying Http requests. If you don't want to see this in results use "Simple Controller" instead.
Look into "Sampler Result" tab of the View Results Tree listener:
If you see one of HTTP status codes 3xx it means that you're being redirected so it's absolutely normal to see blank response if this is the case of redirection
You can control the behaviour of the JMeter when it comes to handling redirect responses by playing with Redirect automatically and Follow Redirects checkboxes in the HTTP Request sampler:
However you need to remember that you don't "need only 1 request", you need exactly the same number of requests like real browser sends so inspect how many requests are being sent by the real browser using your favourite browser developer tools and ensure that JMeter sends the same amount of requests and they have the same nature

JMETER Assertion for response not working

I have my Response assertion updated as shown in screenshot. it work when condition match but when it doesn't match i still get error because response is null. as the request posted is successful
If you expect particular that request to have HTTP 404 status and you want to mark it as successful - just tick Ignore Status box and that would be it.
Also make sure that the assertion is applied only to this sampler(s) it should be applied to, in order words it acts according to the JMeter Scoping Rules and you need to be aware of these rules.

Ajax response - success / failure

I have seen multiple ways in the past of returning success/failure responses from ajax controller actions from backend services.
Is there an accepted best practice for this?
Im thinking in terms of whether the call was successful and also the transport of any error messages.
http codes
true / string (which would contain the error message)
json encoded object containing success/failure flag + data
etc
Ive seen things like the above and also 'success' / 'error' responses etc.
My specific scenario here is a controller say for example testConnectionController. It tests whether a database connection is active or has any issues and reports the status back to the client.
You should definitely follow the recommendations for http response codes. Don't be tempted to ignore setting the response code in favor of some structured json error response. Other than that it is really dependent on the needs of you application. What ever you end up going with it is helpful to be consistent across all of your responses. e.g. If you are going to return an error as json make sure every http end point returns the same structure. That way your client can react in the same way to every error response. Generally speaking there isn't much your client is going to be able to do other than display the error to the user so a simple response like this, with various messages, will cover most cases:
{
"success" : false,
"message" : "Terrible things occurred!"
}

why Loadrunner Correlation is getting failed

I want to correlate this 181-418-5889 in the following statement: regSend&transferNumber=181-418-5889".
I used the regular web_reg_save_param: But it failed... any suggestion?
You are using the statement in the wrong location, such as using it just before the request is sent containing the correlated value versus just before the location where the response containing the value is sent to the client
You are not receiving the correct page response and as a result you may not be able to collect the value. The page may be an HTTP 200 page but the content could be completely off. Always check for an appropriate expected result
Your left boundary, right boundary and other parameters are incorrect to collect the value you need
You have not been through training and you are being forced by your management to learn this tool via trial and error
1- I am not using the statement in the wrong location since I did find the needed value I want to correlate via the Tree function and put it just before the statement that hold this value
2- The Page is not an HTTP 200
3- The Left and right boundary are correct since I checked the text if it does exist twice in the response body.
4- I know the tool (Loadrunner) but in fact, the application is developed under ZK platform and I am not sure if ZK and Loadrunner are compatible knowing that I did implement the dtid function in my script to have a static desktop id each time I replay the process.

Prototype.js, AJAX form submission occasionally returns status 0, XHR stays in readyState 1

I've got an odd problem here with Prototype 1.7.0 and an AJAX form submission using form.request().
The response status is either 202 or 200 depending on whether the server expects to be polled again with the same form submission after a timeout. 200 indicates that the response contents are done and are to be displayed to the user (backend uses WebWork's execAndWait-interceptor to execute a long-running job).
The problem is that most of the time, everything works just fine. However, occasionally, the response comes back as status code 0 and XMLHTTPRequest readyState 1. Firebug indicates correct response codes are coming from the backend, and that the actual response contents are fine, it's just that Prototype's on200 and on202 handlers do not fire (on0 does).
It appears there are similar issues reported over the Internet, but there is no conclusive solution. Is this some well known problem?
A response code 0 from prototype means that it can't communicate with the server. You can remedy this by adding an "on0: function() {}" event handler in your request.
How you handle it is up to you...either alert the user that something went wrong, and redisplay their form, or silently try and re-submit your request to the backend in a loop. If you choose the second option, set a wait timeout and each time you can't talk to the server multiply it by some factor so you don't infinite loop their browser.
You might also want to look into queuing these requests on the client-side so you're only firing one at a time, in order.
Hope that helps.

Resources