I am trying to build page performance related utilities in selenium framework on .NET. For page performance I am considering page load time and page weight as the outputs. I am planning to calculate page timing metrics using WebTimings API of the browser. But I am not able to find out any way I'll be able to get the size of the page that gets loaded, programmatically
Are there any libraries that will help me achieve it? Or can Selenium be used for this use case?
Does page weight mean the sum size of all the resources that get downloaded, or just a .html file? What should I consider when I want to calculate page weight?
Yes, I think you want to do something using Browsermob Proxy , which will give you all those stats via a .har file .
Related
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)
How can we test different elements' response time? I am really quite new to Jmeter. But nowhere could I find how to test response time of some particular elements only e.g. assume that in a page there are many images present. Are they loaded properly ? If yes, how much time they took?
I will be really grateful if you could help me with that by providing some link or tutorial.
Jmeter is server side testing tool.(jmeter will give you total response time for response containing images and other payload at a specific load on server)
What you are asking comes under client side page rendering.
For loading of images you can use client side tools and browser plugins or profilers.
I would prefer browser plugins for this like firebug, pagespeed or performance testing sites like GTMetrix etc.
they will give total page rendering time (for all requests,images,reponse,css,js everything)
Hope this solves your question
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.
When I make HTTP Request in JMeter I get Response data like "This page uses JavaScript and requires a JavaScript enabled browser." How is it possible to fix this problem.
JMeter is not a browser, and does not interpret the JavaScript in downloaded pages.
From the JMeter wiki:
JMeter does not process Javascript or applets embedded in HTML pages.
JMeter can download the relevant resources (some embedded resources
are downloaded automatically if the correct options are set), but it
does not process the HTML and execute any Javascript functions.
If the page uses Javascript to build up a URL or submit a form, you
can use the Proxy Recording facility to create the necessary sampler.
If this is not possible, then manual inspection of the code may be
needed to determine what the Javascript is doing.
Depending on what you are doing, you could create an execution test using Selenium IDE for Firefox. The test will run in your browser so the JavaScript will also run. Note though that I never used Selenium as a substitute for JMeter and don't know about common features to both the tools.
I suppose you can use the WebDriver plugin to run real browser tests (IE/Firefox/Chrome/Selenium).
There is good documentation here
You can add WebDriver to JMeter test to fully evaluate the page rendering.
Web Driver Sampler automates the execution and collection of
Performance metrics on the Browser (client-side). A large part of
performance testing, up to this point, has been on the server side of
things. However, with the advancement of technology, HTML5, JS and CSS
improvements, more and more logic and behaviour have been pushed down
to the client. This adds to the overall perceived performance of
website/webapp, but this metric is not available in JMeter. Things
that add to the overall browser execution time may include:
Client-side Javascript execution - eg. AJAX, JS templates
CSS transforms - eg. 3D matrix transforms, animations
3rd party plugins - eg. Facebook like, Double click ads, site analytics, etc
All these things add to the overall browser execution time, and this
project aims to measure the time it takes to complete rendering all
this content.
Official guide: https://jmeter-plugins.org/wiki/WebDriverTutorial/
You need to add HTTP Cookie/Cache Manager to your thread in order to solve this.
I have a silverlight application, that I want to calculate page load time through C# using Fiddler API. Could you please share some useful guidelines how I can do it using fiddler/fiddlercore. Here are some details what I want to do...
Launch fiddler and launch IE (without using httpweb request)
Load my application url.
Calculate page load time
Earlier I tried to use httpwatch API to calculate it. Httpwatch do all these stuffs, but it doesn't calculate the silverlight component load time.
Please help.
Thanks,
Pritam