appium / appium-flutter-driver

Appium Flutter Driver is a test automation tool for Flutter apps on multiple platforms/OSes. Appium Flutter Driver is part of the Appium mobile test automation tool maintained by community
MIT License
464 stars 184 forks source link

Hangs test execution due to flutter locater not present on screen or app/screen crashed #733

Open TestMagic0989 opened 2 months ago

TestMagic0989 commented 2 months ago

Hangs whole execution of test at the same test step when do not find flutter widget with byValuekey or byText. please find logs:

[6bd5f8b2][FlutterDriver@fb8a] >>> {"command":"waitForAbsent","finderType":"ByValueKey","keyValueString”:”my_key","keyValueType":"String"}

[d44564a3][FlutterDriver@fb8a] Connection to ws://127.0.0.1:41293/Zw4g5AV3WERD=/ws closed

[6bd5f8b2][AndroidUiautomator2Driver@4ba2] Shutting down because we waited 60 seconds for a command

[6bd5f8b2][AndroidUiautomator2Driver@4ba2] Deleting UiAutomator2 session

[6bd5f8b2][AndroidUiautomator2Driver@4ba2] Deleting UiAutomator2 server session

[6bd5f8b2][AndroidUiautomator2Driver@4ba2] Matched '/' to command name 'deleteSession'

[6bd5f8b2][AndroidUiautomator2Driver@4ba2] Proxying [DELETE /] to [DELETE http://127.0.0.1:8200/session/74345tfca-18bd-4b50-8a3d-23edsf5e345e] with no body

[6bd5f8b2][AndroidUiautomator2Driver@4ba2] socket hang up

[6bd5f8b2][AndroidUiautomator2Driver@4ba2] Did not get confirmation UiAutomator2 deleteSession worked; Error was: UnknownError: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to the remote server. Original error: socket hang up

[d44564a3][AndroidUiautomator2Driver@4ba2] [Instrumentation] io.appium.uiautomator2.server.test.AppiumUiAutomator2Server:

[d44564a3][AndroidUiautomator2Driver@4ba2] [Instrumentation] The process has exited with code null, signal SIGTERM

[6bd5f8b2][ADB] Running '/usr/local/share/android-sdk/platform-tools/adb -P 5037 -s emulator-5554 shell dumpsys activity services io.appium.settings/.recorder.RecorderService'

[6bd5f8b2][ADB] Running '/usr/local/share/android-sdk/platform-tools/adb -P 5037 -s emulator-5554 shell am force-stop group.my.app'

[6bd5f8b2][ADB] Removing forwarded port socket connection: 8200 

[6bd5f8b2][ADB] Running '/usr/local/share/android-sdk/platform-tools/adb -P 5037 -s emulator-5554 forward --remove tcp:8200'

[6bd5f8b2][AndroidUiautomator2Driver@4ba2] Restoring hidden api policy to the device default configuration

[6bd5f8b2][ADB] Running '/usr/local/share/android-sdk/platform-tools/adb -P 5037 -s emulator-5554 shell 'settings delete global hidden_api_policy_pre_p_apps;settings delete global hidden_api_policy_p_apps;settings delete global hidden_api_policy''

[6bd5f8b2][Logcat] Stopping logcat capture

Appium 2.0 desired capabilities: "platformName": "Android", "platformVersion": "13.0", "deviceName": "emulator-5554", "automationName": "Flutter", "retryBackoffTime": 500

TestMagic0989 commented 1 month ago

@KazuCocoa do you have any idea about this. If yes please help e out with this issue. Thank you!

KazuCocoa commented 1 month ago

What about adding timeout like https://github.com/appium/appium-flutter-driver/blob/7d57cc8363c7c321d36e9cc12e53fb000f53d18e/example/nodejs/src/index.js#L156 ?

TestMagic0989 commented 1 month ago

@KazuCocoa I tried what you suggested but it doesn't seem to work, I think it is bug while we use automationName as Flutter and use these functions and if element/widgets are hidden not visible or not founds on screen these test hangs and does not properly shut down appium flutter driver and appium server. Btw, just to mention In my case, I am switching context between NATIVE_APP and FLUTTER multiple times in use cases. So please suggest how we can address this issue and if this is known issue then do we have any workaround or solution for the same.

TestMagic0989 commented 1 month ago

Anyone any clue!!