1

I need to create 2 use cases in the same thread. User A - restricted user. User B - administrator. I have over 100 operations. Everything is parent/child... so,

I need User A to initiate HTTP request, in which it fails, IF User A Fails, User B needs to repeat the Request successfully so the request can create a Parent and User B can try the next Request which is a child of the first request. Over & Over again. (Cascading action)

I am using ver. 2.13 because of Maven 2 on Hudson.

A real world example would be if a cashier at the grocery store makes a mistake in ringing up an item and has to have a manager over-ride to continue with the sale. He makes it good and the tabulation continues. That is a little over-simplified, but I need training-wheels and a motorcycle.

Thanks in advance.

2 Answers 2

1

Assuming you know the actual HTTP sequence in this scenario, you would execute a Thread group contaning:

  • request user A
    • catch response for user A
  • request user B
  • next request user B
  • whatever other request would describe your scenario

Your logic of parent/child is something which is contextual to your application. Jmeter just executes HTTP(S) request you would have gathered/know from your flow. You can record the flow with a browser and the recorder although I prefer creating my scripts using Fiddler to analyze the actual HTTP traffic.

In a more elaborate script you could mix the good and the failing scenario's and let them run (randomly) so your application would be tested in a more possibly realistic way.

0

My expectation is that you have User A and User B in different Thread Groups. So in order to trigger User B conditionally you need to have some form of communication between Thread Groups. The easiest way of conducting your use case is using Inter-Thread Communication Plugin

You can check out SynchronizationExample.jmx for real life use case of passing cookies between thread groups so 2nd Thread Group basically "waits" for cookie to become available. You need to do the same with your scenario, the JMeter Variable you're looking for is called ${JMeterThread.last_sample_ok}

You can install Inter-Thread Communication plugins bundle using JMeter Plugins Manager

JMeter Inter THread Communication installation

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.