SHould i ignore ajax,css,call in jmeter load testing - jmeter

I am new to jmeter load testing. i am using jmeter test script recorder to record and run the load testing and jmeter capture all type of calls including css,ajax etc.While doing load testing should i ignore css,ajax or i have to include them as well?

Well-behaved JMeter test assumes that each JMeter thread (virtual user) replicates real user with all its stuff including
CSS, JavaScript, fonts, images, etc. downloading
cache
headers
cookies
think times between operations
etc.
So you:
Should not be recording these calls as if you record them - JMeter will execute the calls sequentially
Instead you need to configure JMeter to download these CSS, images, etc. using parallel pool of 6 threads (this is what real browsers do). The same applies to AJAX calls, they're being executed by the same pool of 6 parallel threads. Also remember that JMeter cannot execute client-side JavaScript so you will have to take care of simulating AJAX requests yourself using i.e. 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.)

We are using JMeter to test a Salesforce application.The login takes 35 secs from JMeter for single user,however from UI it takes maybe 15secs

Showing this value to the client would raise questions. How to clarify the response time.
There are multiple requests in one transaction, the UI runs these requests in parallel and JMeter runs these sequentially and adds the response times of all sub-request .Could that be the reason for high response times only from JMeter.? IF so then JMeter has an issue and not reliable !?
Please help on this issue.
Thanks in advance.
If "UI runs these requests in parallel" then JMeter must run these requests in parallel as well.
If the requests are related to so called "embedded resources" - images, scripts, styles, fonts, sounds, etc. - just tick the appropriate box in the HTTP Request Defaults and remove the individual calls to images, scripts, etc from your test plan
If the "requests" you're talking about are i.e. AJAX calls you can "tell" JMeter to run them in parallel by placing them under the Parallel Controller (it's a plugin installable via JMeter Plugins Manager)

Newbie, need help in designing test plan in jmeter for concurrent API calls

We have a Rest Server talking to 128 devices. I need to send 10 API calls to each device and to all 128 devices at the same time. So the Rest server needs to handle 1280 at a time every 15 mins. I am using jmeter and can create 1280 threads to make each API call unique to go to all 128 devices manually. Is there a better way to do it other than manually typing and populating the threads?
Basically, I am looking to automate the process of creating the threads through a script and load the jmx to GUI, or better/faster way using GUI itself
Normally the following test elements are being used:
Recording: using HTTP(S) Test Script Recorder for automation of the HTTP Request samplers creation. The idea is that you execute your test scenario on mobile device and JMeter captures the traffic and creates the relevant requests.
Parameterization: if your want to use different data for different virtual users you can configure JMeter to read it from external sources (files, databases, etc.), the most commonly used test element is CSV Data Set Config
Synchronizing Timer: this guy ensures that samplers it its scope are executed at exactly the same moment. Normally JMeter executes requests as fast as it can, but it doesn't guarantee that requests will happen at exactly the same moment unless you use the Syncrhonizing Timer.

Jmeter - How to load test ajax web applications by multiple users with cache

I have been using Jmeter for performance testing my web application. I have recorded the jmeter script by excluding js,css and other static content files.
While running the script, Jmeter doesnt execute javascript files so ajax XHR request are not sent. To overcome this i have recorded the script with js, css and other static content and it recorded all the Ajax xhr request too. But the performance results seems to be different from the browser loading time. Also i need to use cache during my performance testing.
Below is how my test plan will look like,
Included Retrieve all embedded resources in HTTP Request manager.
Concurrent pool size is 6
I have added HTTP cookie manager and Cache manager.
I have added a loop controller (This is for caching, jmeter will cache the files on first iteration and it will use the cached files
after that)
The problem i am facing is that the time taken for rest call are double the time shown in the browser console for single user. I have tried all other combinations but always i am getting higher time than the browser console.
I have tried to use the Selenium webdriver plugin to simulate the browser behavior but it doesnt seems to be using the cache. (https://www.blazemeter.com/blog/how-load-test-ajaxxhr-enabled-sites-jmeter)
Is there any other way to solve this problem? I want to take the metrics with cache so kindly suggest me any solution that must include cache. Or is there any other tool similar to jmeter that could solve this issue. My goal is to take web page load time with cache for 'n' number of users.
PS : I am even interested to write any scripts in jmeter but the scripts should not overload the performance of jmeter.
Thanks in advance.
You should not be recording calls to embedded resources (images, scripts, styles, fonts, etc.) as if you record them - they will be executed sequentially while real browsers do this in parallel. So remove recorded requests for the embedded resources and "tell" JMeter to download them (and do it in parallel) using HTTP Request Defaults
You should be recording AJAX requests, however real browsers execute them in parallel while JMeter runs them sequentially. In order to make JMeter's behavior closer to real browser you need to put these AJAX calls under the Parallel Controller
You can install the Parallel Controller extension using JMeter Plugins Manager
Jmeter and caching are unrelated - everything that happens after data went over the wire is out of scope by design. You should only ever simulate requests that you expect NOT to be cached. So this is the feasible part: drop all requests that you expect the browser to cache from the Jmeter script (or move them outside the loop). On the load time of XHR: the browser will most certainly use HTTP keepAlive. Result is that all requests except the very first skip the setup and teardown phase of TCP sockets and are much faster - esp. when the request itself is small and quick. You can simulate this in JMeter also by checking the KeepAlive option AND selecting http commons as implementation. You can read up on this in the docs here: http://jmeter.apache.org/usermanual/component_reference.html#HTTP_Request

how to run JMeter load test and JMeter Webdriver test in paralle

I want to do browser based load testing with JMeter.This I can achieve by using web diver sampler and a thread group with multiple concurrent users. This limits me to test only with about 10 users as opening more browser instances eats away my system resources.My objective is to see how the GUI behaves when the server is under heavy load (say 1000) users.
As per the Web Driver Tutorial
Note: It is NOT the intention of this project to replace the HTTP Samplers included in JMeter. Rather it is meant to compliment them by measuring the end user load time.
So you should not be creating the main load using the WebDriver Sampler, you can use it in another Thread Group in parallel with the main load conducted by the HTTP Request samplers to measure page rendering speed, catch any markup or JavaScript errors, etc.
Well-behaved JMeter virtual user looks just like a real user using the real browser from backend perspective so make sure you properly mimic real user behavior, to wit:
"embedded resources" handling (images, scripts, styles, fonts, etc.)
cache
headers
cookies
"think times"
Check out How to make JMeter behave more like a real browser for more details.
This is the case to work with Remove/Distributed Testing
Note: The same test plan is run by all the servers. JMeter does not distribute the load between servers, each runs the full test plan. So if you set 1000 Threads and have 6 JMeter server, you end up injecting 6000 Threads.
So in your case if you have 100 JMeter servers each will execute 10 users opening browser.

Resources