Forum Discussion
Hi Rao,
My use case is validate whether service is up and running or not in run time then continue to execute the remain test cases in test suite level.
Ex: My test suite contains 3 or more test cases(Operations) and execute all the operations in test suite level.
if first operation soap response is valid then execute all the operation otherwise stop the execution.
Above scenario i did on test case level then it was stopped one operation but it wouldn't stop the remaining operations.
Below script i have written in one of the test case then it was stopped one operation successfully but it is continue to execution to other test cases
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","**Services is down **");
tc.setPropertyValue("Description1"," ");
testRunner.cancel(); /* test case level*/ }
Now, I need to stop the entire execution if soap response failed.
Thanks
- saprao8 years agoOccasional Contributor
Hi,
Can you any one please answer the above question. Please try to help me ASAP.
Thanks
- JKambli8 years agoStaff
Try adding fail and break statement.
- saprao8 years agoOccasional ContributorKambil, Thanks for immediate reply. I have tried both the things it wouldn't stop the testsuite execution in runtime. testrunner.fail(); break; Note : Tried with testrunner.cancel().. it was stopped at test case level but it wouldn't stopped entire testsuite execution. Thanks