Much difference in time by single user without tool and single user with jmeter - 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.

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 give error "We are sorry but vue-dms-ui-component doesn't work properly witouth Javascript enabled.Please enable it to continue"

In Jmeter, I have used "Recording with Think Time" for an application. Now when i run, in the Response I get message "We are sorry but vue-dms-ui-component doesn't work properly witouth Javascript enabled.Please enable it to continue".
I get this message for all the requests. I have enabled JavaScript in Firefox and then captured the recording.
Attaching the screenshot of the message.
enter image description here
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 it's not possible to "enable" JavaScript in JMeter.
If JavaScript is being executed on client-side only you can simply ignore this
If JavaScript generates a single network request - you need to mimic it using HTTP Request sampler
If JavaScript generates more than 1 network request at a time - use as many HTTP Request samplers as there are AJAX requests and put them under the Parallel Controller
Don't forget to perform correlation of dynamic parameters as in the vast majority of cases you cannot just replay the recorded network traffic.

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?

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

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

How to execute Ajax requests in JMeter?

I want to execute Ajax requests in JMeter. I record my test plan with JMeter and BlazeMeter but none can handle Ajax requests. How can I solve my problem?
Or is there any tool that can send concurrent Ajax requests?
Thanks in advance,
M.A
By default, Ajax requests can't be simulated by JMeter as it does not process .js files (As of 3.1 version). You have to explicitly add the requests (HTTP Samplers) for AJAX requests.
Use Network tab of a browser (F12 option) and filter the traffic by xhr, which shows only AJAX requests. Add those requests as HTTP Samplers in the script at the point you needed in the Test Plan.
Browser can process .js files, hence AJAX requests are sent from the browser. When you record the script using HTTP Test Script Recorder, as you are using the browser to navigate, even AJAX requests (originated from js files) will also be added/recorded to the Test Plan.
Since JMeter can't process .js files due to limitation, manually add the AJAX requests (nothing but HTTP Get or Post requests) using HTTP Sampler, if you are building the Test Plan without HTTP Test Script Recorder.
Note: If you are using HTTP Test Script Recorder, no need to add them manually as they are already recorded in the Test Plan.
you can do that by recording http traffic with JMeter Proxy
http://jmeter.apache.org/usermanual/jmeter_proxy_step_by_step.pdf
but it is only possible to replay the same traffic, can be problematic for sessions, cookies...
Better solution is to use WebDriver
https://jmeter-plugins.org/wiki/WebDriverTutorial/
https://jmeter-plugins.org/wiki/PluginInstall/
the needed package is https://jmeter-plugins.org/files/packages/jpgc-webdriver-1.4.0.zip
It is not possible as kicking off more threads than originally defined in the Thread Group is not currently supported, the feature is being tracked as Bug 53159. AJAX requests are "normal" HTTP Requests so JMeter can record and replay them, but when it comes to asynchronous execution - you cannot do this as of now. The workaround options are in:
Use WebDriver Sampler plugin so each JMeter virtual user will kick off a real browser. Warning: this way is very resource intensive.
Use scripting, i.e. JSR223 PostProcessor to kick off AJAX-driven requests via Apache HttpComponents
Develop your custom sampler. You can use the current way of handling embedded resources as a reference.
Learn more: How to Load Test AJAX/XHR Enabled Sites With JMeter
I had this same problem after recording samplers using the JMeter Proxy. The answer was on this blog post: https://lincolnloop.com/blog/load-testing-jmeter-part-1-getting-started/ - see the Ajax Requests section.
Add an HTTP Header Manager for the ajax request and make sure you are sending the X-Requested-With:XMLHttpRequest header.

Resources