Jmeter - Conditional execution

19 Views Asked by At

I have a Jmeter script in which one of the sampler response contains json values as following: 4 JSON result sets containing values of contractid, amount, status, type

The contract ids and their amounts are dynamic in nature. Im trying to figureout a solution where the condition should be if costAmount equals 677666.00 then it should capture its associated contract id and pass that contract id in the subsequent request.

Am completely new to jmeter and this is my first script. I checked with multiple options like using a bean-shell post processor, using loop along with if controller but everytime i end up with not executing the if controller.

Can someone explain with a working solution. Appreciate any inputs on this

Tried beanshell post processor code Loop controller with if controller Still no luck. No matter what conditional statements never execute. Not sure where am i doing wrong

1

There are 1 best solutions below

0
Ivan G On

Conditional execution is possible, for example you can use:

  1. JSON Extractor which provides the way to use filter operators to conditionally extract values:

    enter image description here

  2. If Controller where you can check the value of contractid JMeter Variable. If Controller's children will only be executed if contractid value has been extracted in the previous step:

    enter image description here