When running my test suite in Android Studio, occasionally there will be an exception thrown from somewhere in my code (not in the test) which will cause the current test to fail (good because the test has found a bug) and the rest of the tests to stop running (not so good). I'd like the tests to continue running so that the entire suite finishes. Is this possible?
Continue Android tests after an exception
Asked Answered
it is not possible by concept of INTERPRETER and COMPILER. Android uses jvm(java virtual machine) and JIT (just in time) compiler. so at the time of bug it will not able to compile further so execution will stop from the point of bug.
As explained by Mayur, it is not possible to do this.
A solution is to split up your testing into separate projects.
It provides 2 benefits:
- You can run tests in parallel (faster execution, especially on multi-core platforms)
- You can catch multiple errors at once
Downsides:
- Requires some project restructuring
- Doesn't allow you to catch ALL errors at once
© 2022 - 2024 — McMap. All rights reserved.