A Test Suite is a dum bunch of Test Cases.
A Test Suite just executes TC1, TC2, then TC3. That’s all.
A Test Suite has no intelligence.
A Test Suite does not control the flow of composite Test Cases with if—then—else manner.
You should try “callTestCase()” keyword:
You will add a new Test Case “Controller”.
The Controller will call TC1, TC2, TC3.
The controller can know catch the result of TC2 exection and can control the flow.
suppose, somehow my 2nd case applyPromo got failed then the complete test case would be failed, and execution would be terminated from that point and the promo could not be deleted which is created earlier means the 3rd case deletePromo will not execute.
Within your called Test Case, applyPromo, you can use a “try / catch” block so if a part of it fails, the catch block gets control of your method (and could provide your method the return value). If your test case passes, then your catch statement does nothing. You can do different things based upon what specific exception was given. Below, I just used the generic Exception, however, you can maybe use, StepFailedException, or ElementInterceptionException, etc. and each catch statement can do something you want.
"applyPromo(some params)"
try {
blah
blah
boom boom bang
blah
} catch (Exception) {
// result = true;
}
result = true;
return result
}