JMeter - Big image not downloaded in the scrpt - jmeter

I have a JMeter script for a page which has many js and images. For some reason when I run that page with "Download all embedded resource", one 1MB image ( the main image on the page) doesn't download in the response. Why is that any idea?

It depends on how the image is linked in the DOM, if it's referenced in CSS it might be the case JMeter won't recognize it, similar situation is described in JMeter Bug 63048
If this is the case - you can add another HTTP Request sampler for obtaining that particular image and put both samplers under the Transaction Controller to measure the cumulative time.

Related

Retrieve all Embedded resources is not working in JMeter

I am using "Retrieve all Embedded resources" advanced option to retrieve all static content.
It work fine but does not retrieve below .js. Is there any Filter or option in JMeter to get below files ?
I don't see any "below .js", just in case be aware of the following limitation:
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 an "embedded resource" is being triggered by the client-side JavaScript - JMeter won't be able to process the JavaScript hence won't download the associated piece of content. If this is your case - you will need to download it using a separate HTTP Request sampler and put both "main" HTTP Request and the second one under the Transaction Controller to get the cumulative time. If there are multiple occurrences of such assets - put them under a Parallel Controller

Page load time in jmeter

How to get the page load time of an application which has n number of CSS, js, images, etc? How to do the configuration in JMeter?I have tried integrating selenium, but I can only find the scenario load time not the exact load time of a page.
There is a special setting responsible for parsing the DOM and retrieval of so called "embedded resources": images, CSS, JavaScript, sounds, fonts, etc.
It lives under "Advanced" tab of the HTTP Request sampler
If you have more than one HTTP Request sampler - consider adding HTTP Request Defaults configuration element, if you define the setting there - it will be applied to all HTTP Request samplers in the HTTP Request Defaults scope.
You can use Dmitri T's solution, but I think that solution is to simulate new users every time. You need to treat Jmeter as a protocol tool rather than a smart fully featured browser. I suggest you do scripts recording and put parallel controller in place and put recorded scripts under the parallel controller.
You need to make sure you understand each time a page is loading, which ones are cache, which ones are not. Using recording scripts to add them under parallel controller, I think you can download the parallel controller in Jmeter plugin manager..

How to find the Browser rendering time for API in jmeter ,does including retrieve embedded resource gives the overall response time.?

I have to do a performance test for application(It has UI) ,It has API requests ,how to find the browser rendering time for APIs , can we do it with retrieve embedded resource. I am quite new to this ,Can someone please guide me.
Not really, 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).
The only way to measure browser rendering time is using a real browser, if you want to do this along with the existing JMeter performance tests - go for WebDriver Sampler, it provides JMeter integration with Selenium browser automation framework so you will be able to kick off a real browser and measure its rendering time (response time of the WebDriver Sampler will be the time from opening the page till the rendering finishes.
If you need the breakdown - consider using Navigation Timing API

How to find exact response time in jmeter?

How to find the exact time taken for my web page to load using jmeter? Since i am getting 3 sec as response time but manually it takes more than that to load the page.
Most likely you didn't check Retrieve All Embedded Resources box in the HTTP Request sampler (or even better HTTP Request Defaults) so your request basically gets only HTTP response but doesn't resolve any nested content (images, styles, scripts, fonts) which have much more "weight"
See Web Testing with JMeter: How To Properly Handle Embedded Resources in HTML Responses article to learn more about how to work with these "embedded resources"
Another inconsistency can be caused by JMeter not executing AJAX requests, i.e. if your application relies on JavaScript-generated requests and rendering their responses. JMeter is not a browser and it doesn't automatically execute JavaScript found in the HTML response so if this is the case you will need to manually add these requests to your Test Plan (or record them using HTTP(S) Test Script Recorder) and measure cumulative time via i.e. Transaction Controller.
As a follow on to Dmitri's post, take the page in question and examine it using the developer tools of your chosen browser. Examine very specifically the split between client side actions (JavaScript, Rendering, Painting, ...) and server side requests. In all likelihood you are timing A with Jmeter and B with your eyes

JMeter does not execute the Javascript found in HTML pages? Confused

JMeter User Manual says: JMeter is not a browser. JMeter does not execute the Javascript found in HTML pages.
I wanted to know exact meaning of this statement.
Most perhaps every webpage have javascripts included.
I am taking an example of testing single page (say home page), and as usual this page have number of js, css, images.
During recording, I recorded all embedded resources.
As far my knowledge, before running a test in jmeter, we have following three options
1. Take only top level request (homepage.html) without selecting embedded resources check-box
2. Take top level request (homepage.html) along with selecting embedded resources check-box
3. Keep top level request along with all other components recorded
Which among 3 is the best option to check page load time (I am assuming 1st option, as it tries to replicate close to browser)
and otherwise, if JMeter do not execute javascript, how am I getting response of js file?
JMeter won't execute JavaScript and won't render the page, but it will download the .js file and record and replay any AJAX call which is driven by JavaScript.
So I would suggest going for option 2, but:
tick "Use concurrent pool" and provide number of threads in interval of 3-8
filter "external" resources via "URLs must match" input
add HTTP Cache Manager to ensure that embedded resources are downloaded only once per thread (this is what well-behaved browsers do)
See How to make JMeter behave more like a real browser article for other tips on how to make your load test more realistic
you can get a response of js file with browser automation tools like selenium or testIT Webtester (a fork of selenium)

Resources