Doubt: Is it possible executing a test if before test gets success on test suite?

Hello everybody, I want to know if is possible to execute the actual test if my before test gets success on Test Suite. In other words, KS will execute the test only if the before test pass.

Thank you

A better way of saying this would be if one test fails in the test suite, you would like the test suite to stop and not run any more test cases?

1 Like

Yes. Use callTestCase.

callTestCase can return a value which can be tested in the calling Test Case.

Briefly …

if(WebUI.callTestCase(findTestCase("testCaseA"), null)) {
  WebUI.callTestCase(findTestCase("testCaseB"), null)
}
1 Like

Thanks Russ,

Using this method, the best practice is to create an 3rd class to do it?

No, another Test Case - I call this a “supervisor” TC because it runs/controls other TCs. If you name it supervisor-something it will remind you that its purpose is to supervise the execution of other TCs.

// Supervisor-AB Test Case

if(WebUI.callTestCase(findTestCase("testCaseA"), null)) {
  WebUI.callTestCase(findTestCase("testCaseB"), null)
}
1 Like

It makes sense.

I think it will help me.

Thank you Russ

1 Like

My solution is :crossed_fingers: