How to run threads concurrently in jmeter - testing

Hi i have created a thread group which contains 10 transaction controller, each control has multiple number of HTTP request samplers.
Now to identify the bottleneck as per the requirement, each transaction control has to run one after another.
For ex: 30 threads- Register and login. send reports and logout is the scenario.
so, For each action i have created 1 transaction controller which contains required http sampler request. First i need to run register for 30 users. after getting the response for all 30 users then only login transaction controller should run. and so on.. one by one.
I tried creating multiple thread groups but i am fetching security tokens in each group. So if i create multiple thread group i cant call variable values of one thread group in another.
So pls if anyone know the solution help me out, i am a beginner to jmeter...

This can be achieved using only 'Synchronizing Timer' element of the JMeter. Please find below the brief description of this element:
Synchronizing Timer: This element is used when you intentionally want to pause the users/threads at a specific step until the count of user mentioned in this element is reached
You can create your script in following structure:
Transaction Controller for Register requests
HTTP Register Request1
HTTP Register Request2
Transaction Controller for Login requests
HTTP Register Login1
Synchronizing Timer [Set the 'Number of Simulated Users to Group by' to 30 and Timeout based on your requirement [Recommended value to set is '300000' i.e 5 minutes]. Do not set Timeout to '0' otherwise your test will remain in running state forever if any of the user gets failed in previous step]
HTTP Register Login2
HTTP Register Login3
Note: In above example, you can see I have added synchronizing timer as a child of first HTTP sampler request of under Login transaction controller.
When the test reach at 'HTTP Register Login1' then before sending this request, it will perform the synchronizing timer and wait for all the users to complete the register action.
For beginners, the following blog posts of RedLine13 are very useful to jump start on JMeter:
https://www.redline13.com/blog/kb/
Also, the response time will definitely increase when you use the synchronizing timer because this timer will pause the test until all user reached the step and then perform the login operation. As all 30 users will perform the login action at the same time so the response time will go high as compared to the case when some users are doing registration and others doing login.
Kindly let me know if you have any questions.

If you want "login" transaction to be kicked off only when all 30 users completed "register" transaction you need to:
Add Test Action sampler between "register" and "login" transaction controllers
Add a Synchronizing Timer as a child of the Test Action sampler and set Number of Simultaneous Users to Group by to 30
This way Test Action sampler will act as a "rendezvous point" so all 30 threads will "meet" there, this way you will get confidence that all 30 threads completed registration prior to starting logging in.
Example test plan:

Related

Logic Apps - HTTP Core - success with 202 status and asynchronous pattern

Here is my LogicApp:
It is calling API which launches process running for 10 minutes, returns 202 and returns location header for status checks and when is done it returns 200. I have asynchronous pattern enabled and time limit set to PT2H in this Logic app. So I expect it to run for about 10 minutes periodically checking status until 200 is received or time out.
However, in overview tab this app shows successful run with duration of 1.09 seconds.
This is a bit counterintuitive. What am I missing?
To check the setup, I updated my API to return status 400 upon completion and my LogicApp is supposed to send email in case of error or time out. API ran fine and returned 400 status, but I did not get an e-mail, so I do nothing polling is happening correct. Any thoughts?
I do repro in my lab after creating a ISE for logic app by using as follows with duration of 5 mins. And after 5 min. received mail as well.
Going to Logic App designer and created with Recurrence Core.
Added scheduler> Delay for the time to hold for http core in delay section as follows:
Then added HTTP core> settings> Asynchronus pattern ON and Timeout set as below:
And set same setting for the send email as well from the setting.
]5
And after that we can save it and run the Logic app . Then We can check the overview as per delay time which i set earlier:
For further information please refer the How Long will aLogic App Continue to check a HTTP 202 Accepted Response and the Doc.

JMeter - Active threats over time

I am new to JMeter. I am working with it the last month. The problem that i am facing is with the graph that shows the active threats over time. What i want to achieve is a linear graph that will show that every 2 seconds a new threat is entering the application and do whatever it needs to do. My set up is as follow:
I can not add loop count to infinite as each user is executing different tasks that can be executed only once. It can not reuse the data and hit the services/tasks again with the use of the same user.
The process is:
Login
Get Requests
Post requests
If i execute my scenario i am getting the following graph:
What i need to do in order to get something like the below:
You're dealing with the Listener which means that it will plot the first data point only when first sampler reports its metrics.
If your first request takes 10 seconds you will see the first dot in the Active Threads Over Time chart at 10 seconds when 3 users are online already.
So if you want to see "smooth" arrival of virtual users you need to add a "synthetic" sampler with a couple of milliseconds response time before your other samplers (for example a Dummy Sampler will be a perfect match), this way listeners will take it as the starting point
Demo:

How to load a single SOAP Request with multiple authentication in Jmeter

I am very new to Jmeter and need to perform a load testing of one SOAP request with 100 Authentication data. I tried the below approach, where I saved the authentication data in CSV file, using CSV Data Config parameterised and passed onto HTTP Authorisation Manager. I am able to sequentially test the SOAP request with all the user authentication data available in CSV, but I need to run concurrently, with all the 100 users. Thanks in advance.
I have 5 users authentication(username/password) in csv file
Set your Number of Threads to 100, and the Loop Count to 1.
Number of Threads has to do with the number of concurrent users that get run.
Loop Count has to do with how many times a user actually does your script.
Note that if your ramp-up is slower than your script time, some users will finish before your test reaches its full concurrency. Check this question for use with the scheduler.
In order to make all the requests to fire at the same time you need to add Synchronizing Timer to your test plan.
Increase "Number of Threads" to 100 on Thread Group level
Add Synchronizing Timer as a child of the SOAP/XML-RPC Request
Set "Number of Simultaneous Users to Group by" to 100
Make sure that CSV Data Set Config has following configuration:
"Recycle on EOF?" - true
"Stop thread on EOF?" - false
Thanks everyone for the quick answer. With the synchronizing timer had to modify "Sharing mode" option to "Current Thread Group" in http://jmeter.apache.org/usermanual/component_reference.html#CSV_Data_Set_Config.

Jmeter: How can I keep 1000 or “X” users login requests session alive using JMeter?

Here is my Test Scenario:
First, I am generating a load which includes only Login Requests (say for 1000 users). I am using "Ultimate Thread Group" and "Constant Throughput Timer" in my script. Constant Throughput Timer Value=120/sec is used. I want to run this test for five or ten minutes. My load would be held for 3 minutes.
During this Test(while loads are held) , I am sending another set of login requests from the different machine (say for 100 users). I want to measure the response time of this 100 users login which I've generated from the different machine.
But My Requirement is: While I'm sending 100 users login requests, My Previous 1000 users login requests session should be alive on the server. I've also checked "Use KeepAlive" in my login sampler.
So, How can I achieve this?? How can I be sure that my previous all the login requests sessions are held on the server?
Test Script:
Image 1: Screenshot for Ultimate Thread Group
Image 2: Screenshot for Constant throughput timer
You need to consider following fields of ultimate thread group -
Shutdown time for 1000 threads ( ramp down time)
Hold load for - for 1000 threads.
Initial delay for 100 threads. ( time between starting the script and first server hit)
start time for 100 threads - make sure the 100 threads get ramp up before 1000 threads get shut down. Each thread would be start after ( start time/ start thread count ) seconds from the previous thread.
you need to configure these values in such a way that the first 1000 threads don't get shut down till the all of the next 100 users are active.
Also you can use the active thread over time graph which is provided with in the ultimate thread group to see how the many threads would be active.
P.S Don't confuse the thread number with number of requests, each thread will create multiple requests for seconds in field " Hold Load for ".

Apache Jmeter-How to apply wait for page load?

After recording the login page script and playback.its giving warning and not allow to login in application..
I have to use wait command for waiting few second for doing all process ..
How can i use wait command for page load
Following approaches are possible:
1) using Test Action (Add >> Sampler >> Test Action).
Its advantage is the following: interval value can be passed as parameter that can be obtained either from file, either generated.
2) One can also look through fixed delay between the search samples whatever response time of the Sample
Actual difference between first approach and second one:
you don't vary pause time depending on response time while webpage proposes a variable pause time to make a request every 30s. With a test action note that if you use transaction controller you won't be able to exclude time taken from response time.
Also one should remember that timers are processed before each sampler in the scope in which they are found; if there are several timers in the same scope, all the timers will be processed before each sampler.
Pay attention to Execution order (section 4.9) of Timers in jMeter.
Throughput Constant Timer usage example.