Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
MohamedGaberM opened this issue Nov 1, 2022 · 0 comments

Comments

@MohamedGaberM
Copy link

Hello
I face an issue with my app

Steps :
1-I just create a simple test case (Just click on a specific button)
2-After clicking on this button, the app should be restarted to open the app again with what I click on it**(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

I try with UI Automator as a recommendation from a good man here on GitHub(Try to help), but the same error still appears

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

Is there any way to handle this step? , especially this case is required to start any test case

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant