0
votes

I have a single Thread Group with 2 samplers. Lets say Sampler A and Sampler B.

Sampler B is dependent on response of Sampler A.Thus these 2 samplers always have to run sequentially , First - Sample A and then Sample B.

Now my requirement is run this thread group for multiple users concurrently.

When I execute this for one user , it runs fine. However when I run for more than one user , the samplers are not executed sequentially within individual thread group thereby causing Sampler B to fail most of the times.

enter image description here Sample B failing

I need an advice on how can I achieve this.

I tried using Syncronisation Timer , Transaction Controller to bundle the Samplers but it dint work

3
Sample A and B should executed independently with unique set of variables between threads, so you shouldn't experience any issue, how do you save response of Sampler A and what is the exact issue?user7294900
Sample B is dependent on response of Sample A. So those couldn't be executed independently. These always have to be executed in sequentail manner with Sample A first and then Sample B.Sjain
Can you explain what isn't working except for the order of samplers in log/listener ?user7294900
Please have a look at 2nd snapshot , the sequence should be Sample A -> Sample B for every user. In the snapshot it is Sample A ( user 1) then again Sample A (2nd user) which is not desired. It should be Sample A (user 1) -> Sample B (user 1)...then Sample A (user 2) -> Sample B (user 2)...so onSjain
If you don't want multi thread and you want sequential change to 50 Loop Countuser7294900

3 Answers

0
votes

Found a solution - Used Critical Controller to bundle up the Samplers together. Hereby the link which provides an example - https://jmeter.apache.org/usermanual/component_reference.html#Critical_Section_Controller

0
votes

You can achieve desired results by using the controllers in your test plan. You can use If Controller for this.

https://jmeter.apache.org/usermanual/component_reference.html#Simple_Controller

0
votes

Critical section controller still doesn't fulfill this requirement. It will still run the threads sequentially in the below order(thread 1, 2 and 3 are executed sequentially) due to name lock on sampler A and sampler B defined within the critical section controller. But the requirement is to run all threads(1, 2 and 3) in parallel, but sampler A and sampler B should execute sequentially for each thread.

Critical section controller behavior: thread 1 - (sampler A then sampler B), thread 2 - (sampler A then sampler B), thread 3 - (sampler A then sampler B),