Jmeter 5 - loop controller concurrency - jmeter

I have a load test plan in JMeter as follows:
Test Plan
|- Thread Group
|- BeanShell Sampler (CSV Read)
|- Loop Controller
|- Counter
|- HTTP Request${counter_value}
|- View Results Tree
Http requests are made depending on the csv lines read and that's the reason for the loop controller. When all the requests are made and go to the View Results Tree information I see that requests are made sequentially (HTTP Request1 first then HTTP Request2 and so on).
So, is there a way to do concurrent requests without using any external plugins or am I wrong about how concurrency is done when using a loop controller?

Loop counter wont create concurrent requests. From your question, it seems that you want change number of threads dynamically. Here are the related questions which may give you some perspective :-
Increase number of threads in JMeter during execution
Change the thread count of test plan in JMeter, at run time

You can use Synchronizing Timer to achieve concurrency.
Check the below links for more information.
How to Use the Parallel Controller in JMeter:-
https://www.blazemeter.com/blog/how-to-use-the-parallel-controller-in-jmeter/
How to Load Test AJAX/XHR Enabled Sites With JMeter:-
https://blazemeter.com/blog/how-load-test-ajaxxhr-enabled-sites-jmeter/
Hope this helps.

You cannot achieve concurrency by using Loop Controller, it can only be used for repeating its children.
The actual concurrency can be achieved by adding more threads (virtual users) on Thread Group level
Given above setup JMeter will start concurrent 10 users which will be executing requests for 60 seconds.
I would also recommend reconsidering using Beanshell Sampler, since JMeter 3.1 it's recommended to switch to JSR223 Test Elements and Groovy language. Moreover JMeter provides CSV Data Set Config and/or CSVRead() function which can be used for reading data from the external CSV files.

Related

Unable to achieve TPS while using throughput controller along with Unique Each occurance parameterization customization

I've to execute a test where one transaction can have multiple-lines (Eg: orders placed by different users in the real world where every user can have different cart size). In order to achieve this I have a products list and I need unique product at every occurrence. I have used a code similar to this "https://www.perfmatrix.com/jmeter-parameter-setting-unique-each-occurrence/" and I was able to achieve unique each occurrence. But the problem is when I am using a throughput controller and constant throughput timer I am not able to achieve desired TPS whereas hardcoded payload with various lines (with throughput controller and constant throughput timer) leads to desired TPS. Do we have any other options to achieve this?
Beanshell Sampler might be the root cause of the problem, according to JMeter documentation you should be using JSR223 Test Elements and Groovy language for scripting since JMeter 3.1 because using Beanshell is a some form of a performance anti-pattern, check out Apache Groovy: What Is Groovy Used For? article for more details.
Another possible reason could be test data itself, for example request A is "light" and returns data in less than one second due to its request parameters and request "B" is "heavy" and returns data in more than 5 seconds.
Throughput of 100 requests A and 100 requests B will be different so you might need to add more threads.

Jmeter hml request order get change when increase the number of users and due to that post reguler expression get failed

I record and run the Jmeter script by keeping number of users = 1, in tread group.
Results tree output:
I increased the number of users to 3 and result tree output order changed.
Therefore my some of regular expression exacter logics get failed and resultant responses failed. How can I avoid this situation.
Is there way to manage result tree execution order.
If your regular expressions are under the requests and not at the same level as of HTTP requests then it should not be a problem.Every thread/vUser will run independently. But, in view results you will see request as and when executed by different threads and not in sequence.
As per JMeter Functions and Variables user manual chapter:
Variables are local to a thread
Each JMeter thread (virtual user) executes Samplers upside down (or according to the Logic Controllers). JMeter threads are absolutely independent from each other and each thread has its own variables.
So the problem must be somewhere else, inspect the state of the variables using Debug Sampler and the response data for /oauth calls - it might simply not contain the necessary token value.
Also there is a suspicious call to bundle.js, my expectation is that you should not be executing it directly. The good practices is to configure HTTP Request Defaults to download embedded resources and use parallel pool to be closer to what real browsers do.
See Web Testing with JMeter: How To Properly Handle Embedded Resources in HTML Responses article for more detailed explanation.

Firing multiple soap requests with different data through JMeter

I want to fire multiple soap requests with different data through jmeter and I want all the soap requests to hit the application concurrently. Also I would like to know if I can do the same thing with soap ui? If possible do describe the steps in detail. Thanks in advance.
For JMeter:
Add HTTP Request sampler to your test plan
Add Switch to "Body Data" tab and put your XML payload skeleton there
Substitute the parts of the body you want to parameterise with JMeter Variables or Functions, the most commonly used for parameterisation test elements are:
CSV Data Set Config
__StringFromFile()
__FileToString()
__CSVRead()
For "concurrency" you also have different options:
If you want X threads to execute requests as fast as they can - just specify them in Thread Group
If you want X requests per second - go for Constant Throughput Timer
If you want all requests at exactly the same time - Synchronizing Timer
For SoapUI check out Simulating Different Types of Load article

how to run two requests sequentially in jmeter

Need some help on Jmeter for the following scenario please I need to simulate these steps in order to load our application.
a) make a request to a web-service.(done)
b) verify the response for some variables and extract a URL address from the response.(done)
c) Now using the extracted URL need to make another request.(extraction done)
d) in response a media file will be sent.
My Plan consists of "stepping thread group-->(Sampler 1)HTTP Request +couple of listeners for data gathering--> (Sampler 2)HTTP Request +couple of listeners for data gathering. the issue is that when i ran the plan the first sampler generated 4 requests but the second one generated only 2 can you tell me why is it so.
In general how can i simulate all 4 steps in one go for a single thread. I hope that i have cleared myself.
In JMeter each thread runs requests sequentially already.
So in order to do what you expect you'll need to use:
Post Processors called extractors to extract data into variables
Variables to inject in the requests
Read:
https://jmeter.apache.org/usermanual/test_plan.html#postprocessors
https://jmeter.apache.org/usermanual/functions.html#functions

How can I test the limit of the number of threads with Jmeter

Is it possible to automate the load tests in Jmeter and increase the number of threads until the first error is observed?
For example I start with testing 16 threads for every seconds and increase the number until i receive an error. But instead of doing this manually can I let this run automatically?
Looking into Pre-defined Properties section of JMeter's User Manual on Functions there is a JMeterThread.last_sample_ok variable holding result of the last sampler execution.
So if you build your test plan as follows:
Sampler which does test action
If Controller checking whether previous sampler was successful
If not - relevant actions (stop test, send email, stop ramping up virtual users, etc.)
The value you need to put in "Condition" input of If Controller should look like
"${JMeterThread.last_sample_ok}"=="false"
See How to use JMeter's 'IF' Controller and get Pie for more information on JMeter's If Controller.
Regarding threads in jmeter You may find those 2 links interesting:
What is the highest number of threads that is reasonable to simultaneously run in Jmeter?
JMeter max. thread limit
Regarding your methodology, why not use slow rampup and see the limit using what Dmitri T has provided ?

Resources