1

I had a question about how to kill app, when espresso (Android UI test) running. I need to kill app when testing. I don't need to pressback option because when write to pressback, app running on the background. Do you know any solution? need help

Kamil
  • 175
  • 1
  • 1
  • 10
  • Does this answer your question? [Android - Espresso testing - Close and app and then re-open it?](https://stackoverflow.com/questions/40508113/android-espresso-testing-close-and-app-and-then-re-open-it) – jeprubio Dec 03 '19 at 08:37
  • Also have a look at this other https://stackoverflow.com/questions/52429163/android-espresso-correctly-test-closing-app-with-pressback – jeprubio Dec 03 '19 at 08:39
  • 1
    @jeprubio I tried this but not kill the app. Application still run in background – Kamil Dec 03 '19 at 08:46
  • I'm also facing the same thing when I created test rule to finish the activity or when I press back from the main activity, In both cases the app still run on the background. @Kamil Did you find a solution for that? – mic123456 May 12 '20 at 14:48
  • Anyone found a solution for this? – Joshua Augustinus Sep 21 '20 at 04:29
  • If kill was wanted because some application state stays after each test then it's mine situation. At least that worked for me - I used Android Orchestrator and that perfectly solved my issues. https://developer.android.com/training/testing/instrumented-tests/androidx-test-libraries/runner#enable-gradle – AnoDest Jan 06 '22 at 17:34

0 Answers0