hrn83au
Simple. Make the following change in the above groovy script.
- Read the previous test step response, use context.response
- Add the condition to determine if the test fails.
- If fails, then call the above code i.e., call your above code conditionally.