appium-flutter-driver icon indicating copy to clipboard operation
appium-flutter-driver copied to clipboard

feature request: Inspect flutter apps in Appium Inspector

Open balakumaran-deriv opened this issue 2 years ago • 5 comments

Current Behavior

Currently, we are unable to inspect our flutter app using Appium Inspector.

Everytime, the Inspector infinitely loads and this is what we are getting from the Appium Server logs.

[debug] [FlutterDriver] Executing Flutter driver command 'getWindowRect'
[debug] [FlutterDriver@c001 (2464f28f)] Encountered internal error running command: NotYetImplementedError: Method has not yet been implemented

Suggested Solution

It would be really helpful if we able to inspect Flutter apps and see the keys.

Additional Information

No response

balakumaran-deriv avatar Aug 24 '23 10:08 balakumaran-deriv

Sounds like the flutter driver needs to implement some new commands for the inspector to support it. This should probably be a feature request for the flutter driver instead for now.

jlipps avatar Aug 24 '23 20:08 jlipps

Yes, this is not for this inspector's feature request.

The difficulty of this issue is flutter_driver by Flutter team only returns string text as current getRenderTree method to get the tree. It is not usable for XPath even if we can parse it to XML style for example as some design's differences.

btw, https://github.com/appium/appium-flutter-driver/issues/56 is an old proposal to use https://docs.flutter.dev/tools/devtools/inspector#details-tree

I'm not sure if we could achieve this as the same level for other drivers like UIA2/XCUITest we provide, while we're welcome PRs

KazuCocoa avatar Aug 25 '23 02:08 KazuCocoa

Let me move this ticket to the flutter driver repo with help wanted

KazuCocoa avatar Aug 25 '23 02:08 KazuCocoa

I'm using Appium Inspector with Flutter app on MacOS and it's working fine for me. If I just connected to the Appium session Inspector will load the mobile app screen infinitely. But if to switch in Appium Inspector several times with 1-3 seconds delay between "Native App Mode" and "Web/Hybrid App Mode" Flutter app screen become visible and I can find some XPaths to use it with "NATIVE_APP" context later.

But if I need Flutter properties instead of Native, I'm using Flutter Inspector in Android Studio

denysord88 avatar Aug 25 '23 22:08 denysord88

First day playing around with flutter and using appium inspector to to review the android build. This loading forever issue started happening after a few successful runs against emulators and a device. I just tried @denysord88 solution and can report it worked for me as well fwiw. I'm feeling ambivalent about this but happy it got me unstuck :).

jonathan-gartland avatar Nov 30 '23 01:11 jonathan-gartland