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
449 stars 181 forks source link

feature request: Inspect flutter apps in Appium Inspector #546

Open balakumaran-deriv opened 1 year ago

balakumaran-deriv commented 1 year ago

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

jlipps commented 1 year ago

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.

KazuCocoa commented 1 year ago

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 commented 1 year ago

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

denysord88 commented 1 year ago

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

jonathan-gartland commented 9 months ago

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 :).