How to stop the selenium or appium test suite execution in middle by any condition

I am trying to run the test suite with 50 test cases,after a certain test case or when certain condition is met, i need to stop the whole test case execution.how to achieve it in selenium or appium?

From your description a simple decision tree should suffice. You don’t say what language you are using but most include an ‘if’ operator. Pseudocode:

if test_case || certain_condition
  raise Error "Hit certain test or certain condition"
end
1 Like

if (condition) { driver.close(); }