Skip to content

Issue: Flutter elements not working after terminateApp() and activateApp() #159

@PrasanjitKar

Description

@PrasanjitKar

Description

While automating a Flutter application using the Appium Flutter Integration Driver, Flutter elements work as expected during normal execution.

However, after restarting the application using:

  • terminateApp()
  • activateApp()

Flutter elements are no longer interactable.

Interestingly:

  • ✅ Native elements continue to work as expected
  • ❌ Flutter elements fail to respond or cannot be located

Steps to Reproduce

  1. Launch the Flutter application

  2. Interact with Flutter elements → works fine

  3. Call:

    driver.terminateApp(appPackage);
    driver.activateApp(appPackage);
  4. Try interacting with Flutter elements again


Actual Behavior

  • Flutter elements are not found / not interactable after app restart
  • Commands targeting Flutter widgets fail

Expected Behavior

  • Flutter context and elements should remain accessible after restarting the app using terminateApp() and activateApp()

Observations

  • Native context (NATIVE_APP) continues to work
  • Flutter context seems to be lost or not re-initialized after app restart
  • Possible issue with Flutter driver session or Dart VM reconnection

Appium Logs

Please find attached Appium.

Appium full logs.docx


Environment

  • Appium version: 3.2.0
  • appium-flutter-integration-driver version: 2.0.3
  • Platform: Android
  • Device/Emulator: emulator-5554
  • Flutter version: 3.38.9

Additional Context

It appears that after calling terminateApp() and activateApp(), the Flutter driver is unable to reconnect to the Flutter engine or Dart VM, resulting in loss of Flutter element interaction while native automation continues to function.


Executed scenario

Scenario: Verify terminateApp and activateApp functionalities

    When Verify user is on login page
    And Launch application without reset
    And Verify user is on login page agian

Thank you for your support in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions