Can we club parallel request in JMeter during recording - jmeter

I am testing an application which invokes groups of parallel http requests during multiple-page navigation.
To mimic real user behaviour I want to club the requests hitting the server parallel.
I know I can use the "Parallel controller" but for that, I need to see the developer tool and club them.
My question is "Can we club parallel requests in JMeter during recording" as in other load testing tools we have functions to club the parallel calls which attach to the script during the recording itself.
" The reason for this question is --> I am getting question from the developer that we can't accept the JMeter result as it does not mimic the real user behaviour(Brower behaviour)" Give me your thought on this also.

JMeter neither can record nor replay parallel requests.
The build-in functionality allows simulating downloading of embedded resources (images,scripts, styles, fonts, sounds, etc.) in parallel, however these resources should not be recorded. Parallel downloading can be enabled under "Advanced" tab of the HTTP Request sampler and/or HTTP Request Defaults.
If the real user sends network requests which are not related to the embedded resources, i.e. AJAX requests - JMeter will record them but will replay them sequentially, to mimic real browser's behaviour you will need to put them under the Parallel Controller

Related

Is there any way to do performance testing on website built on react js using Jmeter without selenium integration?

I want to perform load test on website built on react js with 500 users.
Is it possible with jmeter without selenium plugin?
You can create JMeter test plans and simulate the 500 concurrent users accessing the system.
Record the test script
Correlate the session variables
Add timers
Configure the thread group
Run the test
There are a number of ways to build a JMeter test plan. You can use HTTPS Test Script Recorder or Blazemeter Chrome Extension to record the steps. Then you will have to add timers, correlate the sessions with the JMeter post-processors, etc to simulate the real users.
Ten ways to build your JMeter test plans
In your Thread Group set the Number of Threads (users) to 500 to simulate 500 concurrent users. Add a ramp-up time (e.g 60 seconds).
Note: Timers will simulate the think time of the users or the delays between the requests. You may use Random Timers to simulate different think times.
It is, JMeter doesn't know/care anything about the system under test technology so as long as JMeter supports network protocols used by the application it should be able to replicate the network footprint of the real browser.
Browsers in their turn don't do any magic, they send HTTP requests, wait for responses and render the response in the browser window.
JMeter is capable of sending HTTP requests via HTTP Request sampler so it can load test web applications, including but not limited to react js ones.
Just don't forget to configure JMeter to behave like a real browser:
Configure HTTP Request samplers to retrieve embedded resources (images, scripts, styles, fonts, etc.) from web pages
Use HTTP Cache Manager to simulate browser cache
Use HTTP Cookie Manager to simulate browser cookies
Use HTTP Header Manager to simulate browser headers
Use Timers to simulate real user "think times" (real users don't hammer the website non-stop, they need some time to "think" between operations, read something, type something, etc.)

Response errors (403) for signalr labels recorded by Blazemeter for Jmeter

I recorded login and logoff requests using blazemeter. After the record nearly 10 request has been created by blazemeter, which some of them includes .../signalr/.../connectionToken labels.
when i run the test these labels return an error like and .
the test included 10 users. The users have different username and passwords. The other labels (another from these signalr labels) return true.
So, i wonder now if i can disable these pages and not include in the tests? or
any solution for this issue?
if i can disable these pages and not include in the tests
theoretically yes, you can ask around whether SignalR is in scope for performance testing and if not you could disable those, however I believe well-behaved JMeter test should act exactly like a real browser so if the real browser sends these requests to .../signalr/.../connectionToken - JMeter should also send them
or any solution for this issue
I don't think you can record and successfully replay anything in Web 2.0 times, the majority of web applications heavily use dynamic tokens for various reasons (saving client state, security, tracking, etc.). When you record the request you get a hard-coded value which can expire or invalidate by other means, you need to identify all the dynamic values like this SignalR token and perform correlation: the process of dynamic values extraction from the previous responses using suitable JMeter Post-Processors and re-using them in next requests in form of JMeter Variables or Functions
If you record the same user scenario second time and compare two resulting test plans all the request parameters which change will require correlation. There is also an alternative recording option which is capable of exporting recorded requests in "SmartJMX" mode with automatic detection and correlation of dynamic parameters, see How to Cut Your JMeter Scripting Time by 80% for more details.

Jmeter5.2.1 : Test Runs are taking more time in Jmeter

I am working on migration of scripts from performance center to Jmeter5.2.1.
As part of this migration , we are using same functional flow which we did in performance center.
My scenario consists of users logging in to the web application perform 10-15 iterations and then logout.
This is my Testplan.
TestPlan
--ThreadGroup1
--Once Only Controller (login of users)
--Loop Controller (10 Iterations)
HTTP1
HTTP2
HTTP3
.
.
--Once only Controller (logout of users)
--csv Config data ( username/password)
--csv config data( unique data for the loop controller)
With this approach I am noticing that the time taken to complete the test in Jmeter is much more than what we have in performance center ( I took care of think times and added the similar values)
Why is my test run slow in Jmeter?
Is loop controller sequential? Meaning at a given time it can run only one request?
If not loop controller what other options we have to satisfy my scenario.
If I include different thread groups , carrying JSESSIONIDs needs to be done across thread groups which is not a best practice to do so.
Update:
Comparison between performance center and Jmeter settings
Below are the settings in Jmeter.
Thread Group settings:
TestPlan :
HTTP Cookie manager in Thread Group
CSV data files in Test plan
Once Only counters for Login and Logout
Loop Controller for Iterations.
HTTP request Defaults: ( Even with out checking retrieve all embedded and parallel downloads its taking more than an hour for 3 users)
TestPlan
Performance Center results :
Every Sampler has HTTP Header manager
Entire Test Plan
Given you send the same requests you should have the same response times, no matter which tool is being used under the hood.
It's hard to say what the differences are without seeing the full scripts from the both tools so generic advice is to use a third-party sniffer tool like Wireshark or Fiddler in order to identify the differences and configure JMeter to behave exactly like the "performance center" (whatever it is)
For example I fail to see HTTP Cache Manager and it will cause JMeter to download embedded resources (images, scripts, styles, sounds, fonts) for each and every HTTP request while real browser does it only once.
I also don't see HTTP Header Manager which might be very important, for example if you send Accept header the server will be aware that the client can understand gzipped responses which will greatly reduce network traffic.
More information: How to make JMeter behave more like a real browser

jmeter active threads and csv - is this setup correct

I am using jMeter to load test logging in and logging out of my application. I have a CSV with 500 uname and pwords, and I have also set the active threads to 500.
Is this the correct way to stimulate a load of 500 users?
From technical perspective - yes, JMeter will pick up credentials from CSV and send them along with the request.
However if you think about what happens in reality logging in and immediately logging out doesn't seem a realistic use case for me. The whole idea of load testing a web application is simulating real users as close as possible, it includes:
Application usage scenario(s): how many users will be accessing your application at the same time and what users will be doing what things? For example given Stack OverFlow the vast majority of users are searching for answers by given criteria, some users are typing questions, some of them providing answers, and some of them are commenting. These all are different behavioral patterns which need to be accurately simulated by your load test
Each user should have a "user session" which identifies him so application would distinguish different users so make sure you have HTTP Cookie Manager in your Test Plan
Real users use real browsers which are downloading images, CSS and JavaScript files using parallel thread pool (around 5 concurrent threads) to speed up page loading process. In order to mimic this behavior you need to configure HTTP Request samplers to download embedded resources and do it in parallel. You can apply this configuration to all the HTTP Request samplers via HTTP Request Defaults.
Don't forget to add HTTP Cache Manager to mimic browser cache as real browsers normally cache embedded resources to disk and don't re-request them on subsequent calls.
So I would recommend reviewing your test scenario and/or load pattern and get familiarized with How to make JMeter behave more like a real browser article

Does a Jmeter thread really approximate a user?

I am trying to setup a JMeter load test, using the Recording Controller.
This results in duplication of all the calls the web browser would make - including css files, js files and images.
Given that a web browser would get these concurrently (performing approximately 10 web requests concurrently). The jmeter documentation tends to equate 1 user to 1 thread - but this does not line up with the way in which modern web browsers work.
Do I need to use 10 threads for each user when setting up my load test?
Strictly Speaking, JMeter can't simulate a browser. JMeter has its own limitations, like not parsing .js files (as per 3.0 version), sending ajax requests from events etc.
But, for your question, there is support in JMeter.
So, you can specify the concurrent pool size as per your requirements, say concurrent pool size value set to 10, which would solve your issue.
Today browser normally sends requests concurrently and each browser has its own max value for maximum connections that can be made concurrently.
Refer following links:
Max parallel http connections in a browser?
and How to solve Chrome's 6 connection limit when using xhr polling.
When you use "Retrieve Embedded Resources" and set Concurrent Pool Size, you ONLY need to add parent sampler, which triggers resource requests like .css, .js files by Jmeter itself. (Eg: add only stackoverflow.com and it will load all the resources like .css, .js automatically). During recording , all these requests are seperately recorded, so you need to remove all of them or create a new plan/thread group containing only parent sampler.
Note: As I mentioned, requests triggered from .js, .csv won't be sent as Jmeter won't parse them like Browser. You need to add ONLY these requests as samplers explicitly. Add View Results Tree and compare the requests triggered by Jmeter and Browser (F12 -> Network tab) to know which request are missing by Jmeter.
First of all, don't record requests to embedded resources. If you click Add Suggested Excludes button the HTTP(S) Test Script Recorder will automatically populate a regular expression to filter images, scripts and styles.
Second. To simulate browser behaviour: 1 main request to the page and several parallel requests to retrieve content you can use "Advanced" tab of the HTTP Request Sampler (or even better HTTP Request Defaults). You can also limit embedded resources to your application under test domain there
Real browsers download images, styles and scripts. However well-behaved browsers do it only once, on subsequent requests these entities are being returned from cache. So make sure you add HTTP Cache Manager to your Test Plan to represent browser cache so you could avoid overwhelming your server with extra requests which don't happen in the reality.
See How To Make JMeter Behave More Like A Real Browser for more detailed explanation and instructions on using aforementioned Test Elements

Resources