Performance testing with Jmeter - jmeter

I've recorded a test script of web application (extJS). The test logs into application (I used login and password saved in .txt file and CSV Data Set Config element), makes some calculations with external webservice and adds some elements to database. It works fine but...
I'm not sure that all of my users do these things at the same time... Is there any way to configure it?
E.g 100 users do the same scenario at the same time?

You can see the exact number of concurrent users via Active Threads Over Time Listener available via JMeter Plugins
If you're not happy with what you're seeing and expect more concurrent users you can consider 2 options:
Increase "Loop Count" on Thread Group level as when JMeter thread has finished executing all samplers and doesn't have any more to run and no loops to iterate - it's being shut down.
Add Synchronizing Timer. It pauses all the threads until the desired amount is reached and releases them at exactly the same moment so you will be able to test i.e. what happens when 100 users are trying to log in at the same time.

Related

Jmeter threads are not ramping down

I am doing a load test of 300 Virtual users on an application. Previously my users were ramping down and test seems to be finished with in time But now as I jump to 500 user test my users are not ramping down and test keep running for like infinite amount of time. Again I run the test with 300 users, 37 users are still in the system and are not ramping down. Hence my test did not finish.
These are the things that I tried to fix,
Increase the HEAP size in jmeter.properties file.
Cleared the cache and rebooted the services (i.e. SQLSERVER and
collab services)
Can anybody suggest that where Iam doing wrong?
It might be the case your server fails to provide response, by default JMeter will wait for the response forever, it might explain the situation you're running into.
There is "Timeouts" section on the "Advanced" tab of the HTTP Request sampler (or even better HTTP Request Defaults configuration element) where you can set maximum values for Connect / Response, in case if they are exceeded JMeter will automatically mark the sampler as failed and proceed.
Alternative options:
You can set maximum test duration using "Scheduler" section of the Thread Group
There is Runtime Controller where you can define for how long its children are allowed to be run.

Using jmeter not all requests processed in database, but in jmeter listener shows all requests hits the server

Using jmeter, I have 10000 users need to hit the server and to respond back with in 40 sec.
During execution (in distributed mode) only 600 users really hitting (Checked in db) in server.
But in AGGREGATE REPORT it shows all requests hits the server.
What is the issue behind this? why the number of requests hits the server isn't consistent between db and jmeter listener?
Probably your test configuration is a little bit wrong.
JMeter acts as follows:
JMeter starts all the threads (virtual users) within the bounds of ramp-up period specified in the Thread Group configuration
Each thread (virtual user) starts executing samplers upside down
When there are no more samplers to execute and no more loops to iterate the thread is being shut down.
You can check how many threads were actually active using Active Threads Over Time Listener or the same chart of the HTML Reporting Dashboard
So you may run into a situation when some samplers have already done their work and some haven't been yet started. Basically you need to provide enough loops to make sure all 10k threads will be up and running for the required test duration.
See JMeter Test Results: Why the Actual Users Number is Lower than Expected guide for more information.

How to run multiple request sequentially in Apache Jmeter

I have an Application where i have to do load test.Its like i have request A and B,and i have to test with 10 users and request should go like first request - A,B ,second request - A,B with ramp up period 0.
Could Any one help on this.I tried doing with Simple controller but the request are sent randomly and fring error
Check the box for "Run Thread Groups Consecutively" in your test plan. It will send your request A and B for first users then for second users and so on.
See this:
If you really need to wait until 1st user is done before starting 2nd one the fastest and the easiest solution would be setting Number of Threads to 1 and loop requests A and B 10 times in your Thread Group configuration.
If for any reason you need to have 10 concurrent users but executing requests sequentially you can go for Inter-Thread Communication JMeter Plugin which allows synchronizing JMeter threads (even residing in different Thread Groups)
The recommended way of installing JMeter Plugins and keeping them up-to-date is using JMeter Plugins Manager

Parallel file upload using jMeter

I am trying to create a jMeter script to perform file upload operation to a web application:
Test Plan
Thread Group
Launch application
Login
Navigate
Upload
Logout
In above case when we have multiple thread group then multiple files are getting uploaded. Although my requirement is to perform multiple upload operation (in parallel) in one thread operation.
How can this be done?
You only need one thread group for your requirements. Just set more users in that thread group and don't set ramp-up time. They will all login as fast as they can and do all the steps you have in your test plan. This would be the simplest way.
But, if you want all of them uploading at the exactly same moment, you can add If controller (preferably with While controller) to check if all of them have passed "Navigate" request and then enable the controller once all of them are ready for upload. This can be achieved by setting up counter which is increased when "Navigate" request is done, and once counter is equal to number of users, tell then to upload.
You cannot upload more than 1 file at a time using single thread
You cannot jump over threads number you've defined for the Thread Group
So the options are in:
Use multiple threads and Synchronizing Timer to ensure that file upload is executed at exactly the same moment
Do some scripting with i.e. JSR223 Sampler in order to trigger multiple file uploads from one thread, just like simulating AJAX calls with JMeter

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