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

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.

Related

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

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

performance test script for an EPP application

Can we perform load tests on EPP applications? The application is a Windows batch file that interacts with the server. Which performance testing tool would be suitable for use? I need some help with this.
The key point is "interacts". If your goal is to simulate hunderds/thousands of Windows machines concurrencty running the batch file the easiest way would be replicating the network traffic generated by these .batch files so you could replay it at scale.
So you need to analyze the network protocol(s) which is(are) under the hood of the batch file used for communication with the server and check if the network footprint can be simulated using JMeter's built-in Samplers or JMeter Plugins, if the protocol communication can be replayed - you can just increase the number of threads (virtual users) in JMeter's Thread Group to simulate multiple simultaneous batches execution.
If batch file uses HTTP protocol for interacting with the server - you will be even able to record the traffic using JMeter's HTTP(S) Test Script Recorder, see How to Run Performance Tests of Desktop Applications Using JMeter article for more details.
It is also possible to kick off multiple batches instance using OS Process Sampler but in this case you won't get reasonable metrics and KPIs

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.)

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.

Multiple Instances of Firefox need to be invoked through web driver sampler of Jmeter

I have created a Thread Group which has Firefox Driver Config , a Web driver Sampler and a View Results Tree Listener.
I have also added CSV Data set Config and passing username and Passwords through it to the application.
I have around 10 Credentials.
The scenario i want to do is, I want all the 10 users to login at the same time i.e 10 instances of the firefox browser to be invoked and do the job. i have given 10 in the thread group, but the users login 1 after the other.
Basically i am doing a performance testing, So i need all the 10 users to login at the same time(Simultaneously). So that 10 instances of firefox can be invoked at the same time.
Can anyone tell me, how can i achieve this in Jmeter?
Just add Synchronizing Timer to your test plan, if you need to test simultaneous login - put the timer as a child of login webdriver sampler.
I assume that you aware of recommendations from WebDriver Sampler Tutorial like
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.
and
JMeter allows the creation of multiple threads, and each thread is responsible for creating load on the server. However, for the Web Driver use case, the reader should be prudent in the number of threads they will create as each thread will have a single browser instance associated with it. Each browser consumes a significant amount of resources, and a limit should be placed on how many browsers the reader should create.
So it is recommended to create main load using JMeter's HTTP Request samplers and using one thread executing WebDriver Sampler to measure real-life user experience. If you still intend to create the main load with the WebDriver Sampler remember that browsers are resource-intensive so you'll need to provide something like 1 core and 1 Gb of RAM to each browser instance so make sure that machine(s) running JMeter have some capacity.

Resources