JMeter View results tree listener displaying duplicate https requests - performance

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

Related

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

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.

JMeter HTTP Request with no html included

I'm trying to do a HTTP request, but in the results tree (or any other sampler) I can't see the HTML of the website and I can't figure out how to do so.
I need that to check if the HTML in the response contains a substring (possibly with an assertion or stuff like that).
If
Your request is successful
Server responds with some data
The HTTP Request Sampler is in the View Results Tree listener scope
View Results Tree listener has been added before the HTTP Request sampler has been executed
You should see the "HTML" under Response Data -> Response Body tab of the View Results Tree listener.
Demo:
If you're trying to open a .jtl results file with the View Results Tree Listener be informed that by default JMeter doesn't save response data in the .jtl files, you will need to amend Results File Configuration if you want to save response headers and data.

How to perform load testing for many users?

I am new to jmeter, I am trying to do load testing for 20 users for the below scenario but facing some issues
There are 3 sequential url, in the first url.. request will be send and in the 3rd url the response message (response is processed) will be obtained.
So to obtain the response message we have to refresh the 3rd url i.e 3rd url will be refreshed until we get a response message like response is processed. If I am doing a load testing for 3 users. for first user the response message may be obtained at 3rd time refresh of 3rd url and for 2nd user it may be obtained at 5th time refresh similarly for 3rd user it may be obtained at 8th or 10th time refresh of 3rd url so we will be getting the response message at any n'th refresh of 3rd url.
On each HTTP request the sample time is calculated however i need to calculate how long for 1 user it takes i.e timetaken ,starting from the 1st request until the response message is obtained in 3rd url
There are 2 issues:
I am unaware of how can I set a condition to click on the 3rd url until response message is obtained.
How can I get the timetaken for 1 user for 3 url i.e from sending request in 1st url to obtaining response message in 3rd url instead of sample time for each url (http request)
Can somebody please help me with this issues
Put your "3rd url" request under While Controller and specify the condition in the way so the request will loop until response matches your expectations
You can measure the whole sequence execution time by putting all 3 requests under Transaction Controller

POST call with same headers and same request body gives different response?

I was using a website (mysite1.com) , and 3 screens deep from the login screen is the screen that I want to reach using bash and curl & simulating the exact same request that would have gone through the browser. What I mean by simulating is sending exactly the same headers (including referer & origin).
Here is what is happening:
I was able to cross the login screen & screen 2 by simulating the browser behaviour
Now, I am stuck at screen 3. The POST call that goes to the mysite1 server is same as the browser would send, every bit of it.
To do the POST call of 3rd Screen , I create a form on localhost with action="URLOf3rdScreenOnMysite1" and method=post. And before submitting, I change the referer origin and other headers using a browser extension.
This is generating the request that I mentioned in point 2.
However,the first two calls for screen1 and 2 were in bash.
There are no cookies being used by mysite1. Session_id is there as a GET query string parameter. I assumed that probably the server is keeping a track of the flow of URLs requested, but I got the error response even when I followed the flow using bash.
The POST call in the 3rd screen returns different response (an error response) when I try to simulate and returns the , even when the flow of URLs requested is the same in both the cases. How can this be possible? How is the server coming to know that these request are different, the one from browser and the other from bash + last-screen-from-browser? Are there any other parameters involved except for Headers + POST Data + URLs requested? Maybe a different connection established when calling the 3rd screen from browser?

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