Apparently an instrumentation test run is stopped when on exception occurs in the instrumented application:
Test failed to run to completion. Reason: 'Instrumentation run failed due to 'Exception''. Check device logcat for details
Is this the desired behavior or a misconfiguration in a custom instrumentation runner?
I'm using a custom MonitorinInstrumentation
[1] in order to automate acceptance tests.
Unfortunately test execution is canceled when on exception occurs in one test. I want the test suite to complete and only mark the failed tests, like in JUnit.
Is there a general approach to execute (connected) tests without quitting the whole instrumentation in case an exception occurs in one test?
Run all tests in a single class The default keyboard shortcut for this is Ctrl+Shift+F10 on Linux.
Instrumented tests run on Android devices, whether physical or emulated. As such, they can take advantage of the Android framework APIs. Instrumented tests therefore provide more fidelity than local tests, though they run much more slowly.
Instrumentation is a process to prepare the application for testing or automation. Part of the instrumentation process may add "instruments" that allow the testing framework to gain access to parts of the application. Perfecto provides tools for instrumenting mobile applications for different purposes.
Instrumentation tests raise an Exception when something goes wrong (e.g. some conditions that you want to check). You can usually avoid some test to fail using try catch statement(or changing those checks). In this case there's something that made Dalvik Virtual Machine stop. This is usually caused by a crash in your app. Try to check carefully your tests flow to analyze if there are some crashes. Also, be sure to not use System.exit(0) in onDestroy() in some of your activities because this can cause your problem. I hope to can help you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With