1

I have below requests in Jmeter, For the Search ID in Action I am verifying the assertion text. I want to implement that when I do not find assertion text, Jmeter script will not perform the next request instead it should go to Vuser_End i.e. Logout request. I need Logout action to be performed mandatory after assertion fail for a particular request but not interested to run all the requests after assertion failed. Could you please suggest me with some examples?

Vuser_Init(Once Only Controller) --HomePage --Login

Action(Loop Controller) --Search the ID --Create the ID. -- Etc.

Vuser_End(Once Only Controller) --Logout

1 Answer 1

1

Put your conditional logic (i.e. "Create the ID" and so on) under the If Controller and use ${JMeterThread.last_sample_ok} pre-defined variable as the condition:

enter image description here

Given the above configuration Create the ID request will be executed only if "Search ID" sampler is successful. If you need to set custom pass/fail criteria for the "Search ID" sampler - go for Response Assertion

Your Answer

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

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