Home > Net >  How to automate flutter based app using appium? is there any separate driver or automation tool for
How to automate flutter based app using appium? is there any separate driver or automation tool for

Time:01-17

I m not able find proper id,xpath or other locator for flutter based app using Appium Inspector! is there any separate driver in appium or separate automation tool for flutter based app? enter image description here

CodePudding user response:

You can use the Flutter Inspector of Flutter . No need to use Appium . Just Click on FlutterInspector on right side of Android Studio .Open it .You will see 2 options:-

 1)Layout Explorer
 2)Widget Details Tree 

You can use this.

CodePudding user response:

If you are using Appium's traditional UiAutomator2 or XCUITest driver to find the UI elements of a Flutter-based app, then you may have issues finding the element using its attributes. This is because the element attributes are not visible to Appium. You may have to use XPath instead, which can be highly unreliable and slow.

To address this issue, Appium folks are working on a separate driver that can be used for automating Flutter-based applications. Apart from this, you can use Flutter's own Flutter driver. There could be other no-code tools as well that you can explore. Each of these options has pros and cons.

Let me list all the major options currently available. Go through it and evaluate it based on your requirements and skills.

Appium's UiAutomator2/XCUITest Driver

With these drivers, you may observe issues finding the UI elements using their attributes. Long XPath is frequently required. This is because all the element attributes used for UI elements in the Flutter app may not be visible to Appium UiAutomator2 or the XCUITest driver.

Appium's Flutter Driver

Appium has a Flutter driver that may solve the above issue, but it is still in the experimental phase. Here's the GitHub link: https://github.com/truongsinh/appium-flutter-driver

With this driver, you may be able to use Flutter's element attributes to find the elements. Since this is still in the experimental phase, you may observe other issues or some other limitations. Please do a small POC and see if this works for you.

Here's the Flutter element attributes list: https://api.flutter.dev/flutter/flutter_driver/CommonFinders-class.html

Flutter's Flutter Driver

Flutter also has its own driver for automating Flutter apps, but it only supports the Dart language, which can be alien to many testers who are accustomed to Java. It may have limited support to the end to end tests that we usually write with Appium. Here's the link to the driver: https://flutter.dev/docs/cookbook/testing/integration/introduction

Maestro (no-code tool)

There is one emerging no-code tool called Maestro that supports Flutter apps. Currently, it supports only emulators and simulators. I have heard good things about this tool. You might want to check it out too. Here's the link: https://maestro.mobile.dev

  • Related