How to conduct performance testing where The service uses meteor js - performance

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

Related

Is it possible to pass Keys.TAB or Keys.Slash using Jmeter through groovy script?

Is it possible to pass Keys.TAB or Keys.Slash using Jmeter HTTP request through a groovy script?
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 pressing tab or slash triggers a network request to your server - you can mimic it by sending the corresponding HTTP Request via HTTP Request sampler. You can check whether pressing a key generates network activity by looking at "Network" tab of your browser developer tools
If pressing a key doesn't generate a HTTP request - you won't be able to test this scenario using JMeter, you will need a real browser driven by the browser automation framework like Selenium. JMeter can be integrated with Selenium via WebDriver Sampler

Can JMeter record capture requests from a .razor page?

Currently on launching the login page of the application (which is a .razor page) through JMeter after providing all the necessary JMeter configurations, the contents of the page are not displayed in UI.
If the source of the request is .razor and JMeter by itself is not capable of recording it, how can such applications be recorded through JMeter? Is there any work around?
As per Wikipedia ASP.NET Razor article
Razor is an ASP.NET programming syntax used to create dynamic web pages with the C# or VB.NET programming languages.
JMeter doesn't know anything about the backend languages/technologies/patterns/whatever, it just sends HTTP requests, waits for responses and measures time in-between
In case of HTTP and HTTPS protocols you can record the requests using HTTP(S) Test Script Recorder
Looking at Introduction to Razor Pages in ASP.NET Core article it doesn't do any magic so JMeter should capture the requests and be capable of replaying them.
Just pay attention to these "async" calls, real browsers execute AJAX requests in parallel so if this is your case - you might want to put HTTP Request samplers representing async calls under the Parallel Controller
If JMeter is not recording anything the reasons could be in:
JMeter configuration is not correct: check jmeter.log file and your browser console window
The protocol(s) in use are not only HTTP/HTTPS, if there is something like WebSocket under the hood - you won't be able to record it with JMeter, you will have to inspect the requests using your browser developer tools and look for a way of replicating them using suitable JMeter Plugins

Using JMeter to test an OpenXava application

I'm facing a problem when writing a JMeter test plan.
The goal is to test an OpenXava based application.
I perform the request with firefox then I try to copy the headers, parameters and cookies in my HTTP request sampler (thus in JMeter).
There are a lot of parameters (36) sent when trying to login. I copied all of them.
However, I can't make it work.
The HTTP response seems useless. It's nearly the same I get when sending a wwrong password with Firefox :
throw 'allowScriptTagRemoting is false.';
//#DWR-INSERT
//#DWR-REPLY
var s0={};
dwr.engine._remoteHandleCallback('1','0',{application:"bdsa",changedParts:null,currentRow:-1,dialogLevel:0,dialogTitle:null,error:null,focusPropertyId:null,forwardInNewWindow:false,forwardURL:null,forwardURLs:null,hideDialog:false,module:"SignIn",nextModule:null,propertiesUsedInCalculations:null,reload:true,resizeDialog:false,selectedRows:null,showDialog:false,strokeActions:s0,urlParam:null,viewMember:"",viewSimple:false});
Do you have a clue about what is happening ? Should I try to test the login page with another method ?
Why don't you just record your flow using JMeter's HTTP(S) Test Script Recorder and your browser.
Set up JMeter Proxy Server
Set up your browser to use JMeter as the proxy
Perform the test scenario in the browser - JMeter should capture the requests under the Recording Controller
Perform correlation if required. If your application is deployed in the Internet you might get benefit of cloud-based proxy service which can perform automated detection of dynamic parameters and generating the relevant code to extract the values and substitute recorded hard-coded parameters with the variables
Don't forget to add HTTP Cookie Manager to your Test Plan - it deals with cookies and cookie-based authentication

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.

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