In Jmeter - How to get time taken to load a page - jmeter

While navigating to e.x landing page the blazemeter recorder gives 10 HTTP requests. In this case, how can I get, how much time taken to navigate landing page. And which one I need to refer from below.
Avg value in Agg Report is 5 sec
90% value in Agg Report is 5.5 sec
Sum of all the requests time in View Results in Table listener is 32 sec
Above times are more than the response time of chrome time hence couldn't get the exact time.
Note: HTTP Request might be sequential or parallel. So I checked Retrieve all embedded resource option also.
Chrome Response time is 14 sec but View Results in Table listener sum value is 32 sec.

Given you properly configure JMeter in order to behave like the real browser, i.e.:
You're sending the same number of requests using the same pattern
Your requests have all the Headers the browser sends
You added HTTP Cache Manager to your Test Plan
You configured JMeter to properly handle embedded resources and AJAX requests
You should be seeing approximately the same response time as for the browser.
Just cross-check the nature of the requests using browser developer tools ("Network" tab or equivalent) and configure JMeter to send the same requests and ensure that JMeter really does it using a sniffer tool like Fiddler or Wireshark.

Related

504 Gateway timeout in Jmeter

During manual run on reaching the Home screen, the page keeps loading and the API calls timeout with 504 error(Received the same error during Jmeter execution)
But if the same page(Home screen) is refreshed three times manually, all the previously timed out APIs load successfully (status:200).
But I'm unable to identify how to refresh the page using Jmeter. Any help on this? Thanks!
I tried adding JSR223 preprocessor with the following Javascript -
load("API-url") in the script section but it doesn't seems to work.
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 in order to "refresh" the page you need to send the same HTTP Request to it using HTTP Request Sampler. If you want to send the same request more than once it makes sense to put in under the Loop Controller
Also given the above quote from JMeter documentation if loading the page triggers some AJAX requests to the API - JMeter won't execute these requests automatically, you will need to create a separate HTTP Request sampler per API request. Also real browsers execute AJAX requests in parallel so if there is more than 1 API request - you need to put them under the Parallel Controller

Jmeter response time is very high for cached request which retrieves 124 embedded resources from cache as compared with browser

Jmeter is giving very high response time(12 seconds) for the request which retrieves 124 cached embedded requests from jmeter http cache manager (Jmeter is cached 120 requests--304 response code and 4 request not cached--200 response code), even http cache manager cache 120 requests why it's giving more response time it's not matching to browser.When browser downloading 124 request it takes 2 to 3 seconds retrieves from memory/disk cache. How can i simulate the same response time in jmeter.
Please see the screen shot jmeter and browser response times in below drive link
https://drive.google.com/drive/folders/1NnGD3dPgmDn60W6CZ534KkU-x2E76Dwy?usp=sharing
JMeter's HTTP Cache Manager will return embedded resources (images, scripts, styles, etc.) from cache starting from 2nd request, for the first request for each virtual user/iteration you will always get full content.
If you're comparing the first request make sure to tick Disable cache box in browser developer tools:
You might also want to inspect request headers and ensure that JMeter sends exactly the same headers via HTTP Header Manager, for example Accept-Encoding header can greatly reduce response time due to requesting compressed content from the endpoint.
More information: How to make JMeter behave more like a real browser

Jmeter Report:-How to download response parallel like browser jmeter shows by adding all sub url responses

Jmeter Report: How to download response parallel like browser? Suppose i have 4 request in one transaction controller and i want to get response parallel for all request instead of sequentially.
In my transaction controller 4-5 http request are present and i want to download response of all request parallel instead of sequential.
In report all response are added and then showing but when we are using browser response are showing by subtracting the depended or complete responses.
If you're talking about "embedded resources" - images, scripts, styles, fonts, etc. - you should not be adding requests for them manually, instead you need to configure HTTP Request Samplers to do this for you (or even better HTTP Request Defaults). The relevant settings live under "Advanced" tab:
If the nature of the requests is different, i.e. they're AJAX requests which are not supported by JMeter out of the box the easiest way of executing them at the same moment is placing them under the Parallel Controller. It is not a part of JMeter distribution bundle and can be installed using JMeter Plugins Manager

repetitive jmeter http request doesn's show in Aggregate Report listener

I've configured 1 thread, loop count 2 and Aggregate Report as a listener with some http request sampler. Caching is enabled. When I run my test plan I get only one sample of each request in Aggregate Report. Some Cached requests are not even hitting second time to server whereas for some are getting executed again. Can anyone explain what settings I need to configure for getting report of all request samples. Thank you in advance.
please find image of result here
This is by design, JMeter's HTTP Cache Manager respects Cache-Control headers like Etag and If-Modified-Since so on second requests embedded resources like image, scripts, fonts, styles are being returned from cache, no actual request is being made. This is what real browsers would do.
If for any reason you want all requests to be executed each time you need to:
Tick Clear cache each iteration box in the HTTP Cache Manager
Remove Loop Controller from the Test Plan
Set desired number of loops on Thread Group level
See Using the HTTP Cache Manager for more information on embedded resources caching if needed.

I am using jmeter and performed load test with 100 users

I am using jmeter and performed load test with 100 users and got http response 200 but cant find the user hit on my server in "No of user tracker" section. its was just showing the 6 real users which was actually right.
Why i am not able to see those 100 request which i generated by jmeter
If your tracking is based on Javascript execution, remember that JMeter is not a browser so it does not execute the Javascript contained in a response (HTML Page).

Resources