question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Espresso]Test instrumentation process crashed. After click action app should restarted but with espresso is crashed

See original GitHub issue

Hi all Steps to reproduce : 1-I just create a simple test case (Just click on the button) 2-After clicking on this button, the app should be restarted (Expected Result) 3-Testcase will fail and I get this error (Actual Result) (Test instrumentation process crashed. Check tests.SplashActivityTest#splashActivityTest.txt for details) The data on file mentioned before : INSTRUMENTATION_RESULT: shortMsg=Process crashed. INSTRUMENTATION_CODE: 0

Prerequisites:

android {
defaultConfig {
...
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        testInstrumentationRunnerArguments clearPackageData:'true'

} }
...
    testOptions {
        unitTests.returnDefaultValues = true
        execution 'ANDROIDX_TEST_ORCHESTRATOR'
    }
    .....
    dependencies {
     // Espresso Dependencies
    androidTestImplementation 'androidx.test:core:1.5.0-beta01'
    androidTestImplementation 'androidx.test.ext:junit:1.1.4-beta01'
    androidTestImplementation 'androidx.test:runner:1.4.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0-beta01'
    androidTestImplementation 'com.android.support.test:rules:1.0.2'
    androidTestImplementation 'androidx.test:rules:1.4.1-beta01'
    androidTestImplementation 'androidx.test.ext:junit-ktx:1.1.3'
    androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0'
    androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.5.0-beta01'
    androidTestImplementation 'androidx.test.espresso:espresso-intents:3.4.0'
    androidTestImplementation 'com.jakewharton.espresso:okhttp3-idling-resource:1.0.0'
    androidTestImplementation('com.schibsted.spain:barista:3.6.0') {
        exclude group: 'org.jetbrains.kotlin'
    } 

    //   orchestrator
    androidTestUtil 'androidx.test:orchestrator:1.4.1'
    }

I try with API 31 and 33 with Emulator and real devices too

Can any one here help me on this issue?

Thanks

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:11

github_iconTop GitHub Comments

2reactions
brettchabotcommented, Oct 30, 2022

Oh I just noticed in your description "2-After clicking on this button, the app should be restarted (Expected Result)'. You cannot restart the app from within an instrumented test, because that will kill the process the test is running in.

If you need to do this you might want to look into using UiAutomator, and setting up your tests so they run in a different process than the application under test.

0reactions
brettchabotcommented, Nov 3, 2022

Did you configure the UI Automator instrumentation to run in a different process than the app under test? See the manifest link I gave above

Read more comments on GitHub >

github_iconTop Results From Across the Web

Test instrumentation process crashed. After click action app ...
I just create a simple test case (Just click on the button); After clicking on this button, the app should be restarted (Hard...
Read more >
Seemingly random 'process crashed' for the instrumentation ...
Any update about this issue? I m getting Test instrumentation process crashed. , randomly. Adding a bit wait before starting the Test process...
Read more >
Flaky deadlock in UI Espresso tests after updating to ...
The test fails with typical 5 seconds timeout stating: Test instrumentation process crashed. Check com.xxx#xxx.txt for details.
Read more >
Espresso Web - Android Developers
Use Espresso-Web to test your hybrid apps, especially the integration of your app's native UI components with its WebView UI components. You can...
Read more >
Dealing with emulator issues and Android UI test failures on CI
System events can happen during your test runs, one of them is when Android is not responding (ANR for short), and you get...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found