Skip to main content

Flutter Driver Support in Appium OSS

Flutter driver is used to run automation tests for Flutter applications.

warning
  • Flutter driver is supported only for Appium version 2 (and Appium Java client 8).
  • Flutter driver is supported only for Automation and not in Mobile Studio.

To test a Flutter application:

  1. Add support for flutterDriverExtension before the runApp command, in main.dart.

    main.dart

    import 'package:flutter_driver/driver_extension.dart';

    void main() {
    enableFlutterDriverExtension();
    runApp(const MyApp());
    }
  2. Add dev_dependencies to `pubspec.yml.`

    pubspec.yaml

    dev_dependencies:
    test: any
    flutter_driver:
    sdk: flutter
    flutter_test:
    sdk: flutter
  3. Build the application.

    • Android: flutter build apk --debug
    • iOS 13.0 and lower: flutter build ios --debug 
    • iOS 14.0+: flutter build ios --profile
  4.  Upload the application to the Cloud.

To run an automation test on a Flutter application:

  1. Pull the appium 2.0.0-beta.55 image from AWS.

    Docker Pull Command

    docker pull public.ecr.aws/dai-ct/appium-opensource:2.0.0.beta.55-6
  2. Set the automation name in the capabilities to be "Flutter".

    capabilities.setCapability("platformName", "Android");
    capabilities.setCapability("automationName", "Flutter");