oleksii
9 years agoOccasional Contributor
Stop load test suite execution from groovy script.
Hi.
The first step in my test suite is SOAP ping request. I want to stop further test suite execution if ping step does not return "alive".
What I tried to do:
- Add a groovy step after SOAP ping step which would validate ping response and run this (tried testRunner and other handlers; compare with "true" to make it executed - will change to false when I find a solution):
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context ) def holder = groovyUtils.getXmlHolder( "ping#Response" ) log.info holder["//Message"] if(holder["//Message"].contains('alive') == true) { log.info "Test execution stopped as ping was unsuccessful." loadTestRunner.cancel("Test execution stopped as ping was unsuccessful.") }
- Tried to add the script above to teardown tab of the corresponding ping load test.
Neither of this worked - . Can anyone give me a piece of advice on how to accomplish this?