Forum Discussion
nmrao
9 years agoCommunity Hero
What is your use case? Where do you want to keep this script in the test suite?
Can you also show how you are doing it for test case currently (script + test case screen shot with steps) would help better.
Can you also show how you are doing it for test case currently (script + test case screen shot with steps) would help better.
saprao
9 years agoOccasional Contributor
Basically, I need to validate whether services are up and running or not through Groovy. Ex : Assume my Test Suite contains 3 or more test cases(Operations) and executing all the operations in test suite level. If one service soap response is getting +ve then execute all the operations. Otherwise stop the execution entirely in test suite level Through below code it is stopping execution in test case level but continuing to next test case. if(assertion.assertable.getAssertionByName("SOAP Response").assertionStatus.toString() == "FAILED") { for( e in assertion.errors ) { def Val_Prop_Message=e.message.toString(); //log.info "Message" + Val_Prop_Message; tc.setPropertyValue("Validation1",Val_Prop_Message); tc.setPropertyValue("Description1","**Services is down **"); } } else if(assertion.assertable.getAssertionByName("SOAP Response").assertionStatus.toString() == "VALID" ) { tc.setPropertyValue("Validation1","**Service Up and running**"); tc.setPropertyValue("Description1"," "); testRunner.cancel(); /* test case level*/ } Thanks