Stress test on website contains video - jmeter

I was using jmeter to stress test my website. But there is website containing videos played by jwplayer. When i send requests it only loads page not playing video. Is there any way to test the page with video?

I'm not an expert on jwplayer (only just heard of it) but I'll take a guess that it is loading the video through some sort of JavaScript/jquery/AJAX mechanism.
From what I understand Jmeter does not process these requests when you fire of a GET request to a page as it is NOT a real browser! If you want to force one of these elements to load * then you must make another GET request with the URL to that element only. On the site I test we have several AJAX elements that I have to test in this way, extracting the dynamic URL from the previous page and using that to load the next one.
*is your website actually hosting the videos, or just linking to a service hosting them? If the latter, there is no point to load testing the videos.

Related

Too many https requsets when web Rqeusting just a single MP4 Video

as you can see in the picture, the chrome has download too many clips of a video when playing a video online.
In rear end, I use springboot WebMvcConfiguer to filter the requests, when request url has '/files/**', it will let the request get the video directly
how can i solve this request problem , and just make the request like this below
Many thanks
I think this is due to the browser loading the video over time versus all at one time. This is typically done for performance reasons and it doesn't seem like chrome likes people working around it. Here is a link to another post about the same thing.

In j meter test script why we exclude java script,cascade style sheet and include only html to check response time in performance test?

While checking performance of public website why we exclude java scripts, style sheets and include only basic request which returns HTML file(host "www.test.com" and "/" in path.
You need to exclude these scripts, styles and images only during recording of your test scenario with the HTTP(S) Test Script Recorder as if you record these calls they will be captured, but when you replay them it will have nothing in common with that happens in the reality.
Real browsers act as follows:
They download these scripts, images and styles when requesting the main page, but do it in parallel using several concurrent threads to speed up the process. So the main request forks into several sub-requests which are downloading all this stuff. In JMeter you can mimic this behaviour using "Retrieve All Embedded Resources" switch either in HTTP Request or in HTTP Request Defaults
As you already know, browsers download scripts, images and styles and do it using several concurrent threads. The next point is that well-behaved browsers do it only once, on subsequent requests this stuff is being returned from the browser's cache. So you need to add a HTTP Cache Manager to your Test Plan to simulate this functionality representing browser cache and not overload the server
Regarding 3-rd party content. If your web site uses scripts, images, videos, etc. from other domains - it is recommended to exclude these requests from your load testing scope as most likely you don't have any control of these 3-rd party content providers and won't be able to do anything even if the bottleneck is due to external server, your load test should focus solely on your application.
See How To Make JMeter Behave More Like A Real Browser guide for more information on above hints and few more recommendations.
Because JMeter is only retrieving page elements, and does not execute javascript or render these components like real browsers do. Personally i like to retrieve all embedded resources to give myself a better understanding of the total load time, even if javascript is not executed/rendered.
You can also do a selective retrieval, or a full retrieval if you wish.
Use the checkbox named "retrieve embedded resources", or specify which elements should be retrieved. Getting full retrieval is also handy to see whether there are broken links to components in the page.

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)

Load time of a page in Jmeter

I understand that the primary use of Jmeter is not finding the load time of a page. However, I'd like to know if there's any tool for the below scenario to calculate the approximate load time of a page (barring the rendering time):
Calculate the response time of various web requests for a particular page P1 using JMeter
Record and save the web request pattern of the page P1 in the desired browser
A tool replaces every web request in the pattern with the response time recorded in Step 1 and based on the timeline slice in Step 2, gives us the load time of the given page P1
Hope I'm making sense
Actually the answer lives at JMeter Home Page
JMeter is not a browser. 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 viewed at a time)
You don't need to do anything as JMeter doesn't actually render page. You may want to perform some tweaks to make it behave more like a real browser, especially HTTP Cache Manager matters.
In regards to saving browser traffic - for Chromium and derivatives you can do it right from Developer Tools by right-clicking a request in Network tab

JMeter : Should we keep "Embedd HTML resource" checkbox enable for load test?

My scenario is to test response time for any web page which has many resources like png, jpg, css, etc embedded.
I need help in understanding whether we should enable or not "Embedd HTML resources" checkbox while running performance test in JMeter based on best practice to be followed to get realistic response time.
A) If I have recorded script then these resources are recorded in script.
So questions are:
1. are we required to use exclusion pattern or not?
2. should we disable all resources recorded from script and simply enable this check box for "Embedd HTML resources"?
3. should we keep recorded resources in the script and disable the check box for "Embedd HTML resources"?
B) If we have created script manually by adding Http Sampler for each web page, then as a best practice should be enable / select checkbox "Embedd HTML resources".
Thanks & Regards.
Choosing whether to include embedded (static) content is dependent on your individual circumstances. There is no 'best practice'.
Two examples:
If I am running a test for a webserver that, when it goes live, will be behind a CDN then for my load testing I could reasonably decide to not send static content on the basis that these requests are going to be handled by the CDN and will never reach my backend webserver. If I did send static content in this scenario then I would be simulating an unrealistic load.
But if my application was not using a CDN and instead had, perhaps, 2 of its own content accelerators then in order to test this setup I would want to be driving static content requests into this network layer (where the accelerators are positioned). If I did not send static content in this scenario then I would be generating an unrealistic load.
There are many, many other factors that can affect why you might want to include or not include embedded resources - only you can make the final choice.
In addition: Consider using a HTTP Cache Manager where you are trying to simulate static content calls.

Resources