All, How to handle application crash in android

All,

Give me suggestion here.

I have 10 test case to be executed, but when if application crashes i have to re launch the app and continue the further test cases.How i’ll find out app is crashed?

Please suggest me some API’s or ideas or functions for me to resolve

If your test cases don’t depend on previous tests, why not re launch the app each time ?
As for detecting app crash, see this topic: How to detect App crash in reality

Thanks Alexis for your reply.

How i’ll come to know my test case failed because of crash or exception?
Is any way to find out the crash during execution? Any API calls supported from Appium?

Did you try the suggestions in the topic i linked ? I don’t know much about it myself since I never faced app crashes.

yet to be try.@alexis

Actually i’m automating Player application. Where i can see app crashes when we perform seek or scrub on particular testcase.

i hope re starting the server and application for each test is not a feasible.

If you have 10 tests and app crash on test #5 then that test will surely fail. If you want more info about the failure you should:

  • Take a screenshot on test failure
  • Get logs on test failure

And attach both to report. Whoever will see the report will surely quickly find the crash. You can even do more if you want, by looking for Exceptions in the logs and mention the found exception in the report

What I do is, I get the adb logs of each test and tag them, then scan for exceptions and report the exception if the test fails.

How to scan exception and report it if test fail?
And it’s been 4 year since so do you found any other solution then please let me know.