I need some help to use JMeter. I want to record two different scenarios like clicking 2 different buttons. If i try to run for 2 users, one user should hit first button, another should hit another button concurrently.
I know this is the basic question. But i am new to this one. Thats why asking here. I have tried like below:
Thread Group
-Throughput Controller
--Login
--Clicking 1st button
-Throughput controller
--Login
--Clicking 2nd button
When i run with 2 users using CSV Data Set Config, both login takes same user.
And also i need to test for concurrency. I am not sure how to execute this one correctly. Could anyone can help me in this?
Logic Controllers help you to control the flow the order of processing of samplers in a thread. It can also change the order of requests coming from their child elements. Following is the list of all Logic Controllers in JMeter: Runtime Controller.
Throughput is calculated as requests/unit of time. The time is calculated from the start of the first sample to the end of the last sample. This includes any intervals between samples, as it is supposed to represent the load on the server. The formula is: Throughput = (number of requests) / (total time).
You can add this element to your test plan by following “Thread Group -> (right click) -> Add -> Timer -> Constant Throughput Timer” path. Target throughput (in samples per minute) value lets you manage the frequency for your requests.
Throughput Controller will work correct if you have more than single iteration.
I.e. you should have N loops (using Loop Controller e.g.) with child Throughput Controller set X percents (X is integer, 0 <= X <= 100) - so than X% from N loops is integer value too.
You may look into this discussion for better examples and explanations.
For your case you can try to use construction like the following:
Thread Group
Number of Threads = 2
Loop Count = 1
+- While Controller
Condition = ${__javaScript("${login}"!="<EOF>",)}
+- CSV Data Set Config
Filename = users.csv
Variable Names = login,pwd
Delimiter = ,
+- Loop Controller
Loop Count = 10
+- Login
+- Throughput Controller
Percent Execution
Throughput = 50.0
+- Clicking 1st button
+- Throughput Controller
Percent Execution
Throughput = 50.0
+- Clicking 2nd button
+- Logout
where
- there are 2 threads (Thread Group: Number of Threads = 2) started simultaneously each with unique credentials extracted from csv-file (While Controller + CSV Data Set Config), used for Login;
- the whole test-flow - login > click button (either first or second) > logout - will be repeated N times using Loop Controller, which one makes Throughput Controller work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With