How to check web page load time in Jmeter without using api.? Is it possible to perform load testing in jmeter without using api's? - jmeter

I was given with a task in which I need to check load time of webpages in Jmeter and there is not any api's available. so hot to perform load testing without having api's.

Add HTTP Request sampler and configure it to hit the page which you need to measure
At the "Advanced" tab tick Retrieve All Embedded Resources and Parallel Downloads boxes, in addition you can exclude external domains there as well to limit JMeter to only your application:
More information: Web Testing with JMeter: How To Properly Handle Embedded Resources in HTML Responses
Add HTTP Cache Manager to your Test Plan (real browsers download embedded resources like images, scripts, styles, fonts, but do this only once)
Add HTTP Header Manager to your Test Plan and configure it to send headers which browsers normally send like User-Agent, Accept, etc.
Add HTTP Cookie Manager to handle cookies
That's it, now you should have more or less realistic page load time. Remember that JMeter is not a browser so it doesn't execute JavaScript so if there are any JavaScript-generated calls - you will need to add a separate HTTP Request sampler per call and put them all under Parallel Controller

Related

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

Javascripts in jMeter response of SPA

I am doing automation using API testing for mobile app.
There are 3 different home screens on app.
Workflow-
1)Login- Sending login API request & in response getting access token which is used in further requests.
2) Screen1-Sending API request on screen1 & getting response -Success
3) Screen2 -sending API request on screen2 & but its not working .It sends 3-4 .js(javascripts) files in response. Screen2 is Single page application. Jmeter does not execute those js from response hence no content seen.
I am blocked here & cant proceed .Any pointer ...appreciated.
First of all check whether JMeter is configured to download embedded resources. You can do it on "Advanced" tab of the HTTP Request sampler (or better HTTP Request Defaults)
If this box is unchecked - JMeter will return only main content but will not process any so called "embedded resources": images, fonts, scripts, styles which are referenced by the webpage.
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
So if there is a JavaScript somewhere in the response which triggers an AJAX request which returns your "js" files - JMeter won't execute it automatically, you will need to add a separate HTTP Request sampler(s) to mimic the AJAX call(s)
None of the load testing tools is capable of executing JavaScript so if you looking for a one - you need to consider real browsers. For example check out JMeter integration with Selenium via WebDriver Sampler, but be aware that this approach is very resource intensive.

How to conduct performance testing where The service uses meteor js

How to conduct performance testing of my web service? The service displays a page, then the login form in the user's Personal account. It is necessary to enter and display the user's personal account. The service uses meteorjs. To display the personal account is necessary to emulate a browser. jmeter as I understand it is not suitable for this test. He(jmeter) is not able to emulate the browser can't request the js script on the client. Can you recommend tools for such testing? And how conduct ?
Thks
Well-behaved JMeter test can do whatever browser does (from protocol-level perspective). JMeter will not execute client-side JavaScript, neither it will render the response, however if JavaScript generates a HTTP request - JMeter can even record it using HTTP(S) Test Script Recorder (or you can manually create this request by adding relevant HTTP Request sampler)
So the options are:
If your request is ad-hoc (i.e. periodic or on-demand) you can use HTTP Request sampler to mimic it
If your request is asynchronous (AJAX) you can go for one of the techniques described in the How to Load Test AJAX/XHR Enabled Sites With JMeter article or use Parallel Controller plugin
And finally you can use JMeter for kicking off real browser instances using either WebDriver Sampler or JSR223 Sampler

Much difference in time by single user without tool and single user with jmeter

I am trying to login to an application first with single user and recorded the time using "Page load time" plugin of chrome and then i am trying to login with Jmeter and applying load of Just 1 user but there is much difference in time.
is my approach correct? if yes why there is difference in load time.
Well-behaved JMeter request should give the same timings as browser does.
Make sure you configure your HTTP Request sampler to "Retrieve All Embedded Resources"
Ensure that you have Parallel downloads ticked
Add HTTP Header Manager and configure it to send all the HTTP Headers which browser is sending.
If web application you're trying to load test is built using AJAX technology you will need to add the relevant HTTP Request samplers to mimic asynchronous JavaScript-driven calls as JMeter doesn't execute client-side JavaScript. Once done you can combine requests into one "Login" sequence using Transaction Controller.
See How to make JMeter behave more like a real browser article for more hints on how to properly configure JMeter for web applications testing.

What is the indication of Result as Cache in httpfox

I am getting Result as Cache for particular request in Httpfox and type as application/json
Real browsers download embedded resources like images, scripts, styles, asynchronous requests results, but do it only once. During subsequent requests aforementioned entities are being returned from the browser cache.
JMeter provides HTTP Cache Manager in order to simulate above behavior.
I think that you might also like to add the following test elements to your test plan to make your JMeter test even more realistic:
HTTP Cookie Manager - to represent browser cookies
HTTP Header Manager - to send browser headers like User-Agent
Configure HTTP Request Defaults to download embedded resources using thread pool as per How to make JMeter behave more like a real browser guide

Resources