Skip to main content

Appium Flutter Integration Driver Testing

Real Device Virtual Device

LambdaTest supports testing Flutter applications on real Android and iOS devices using the Appium Flutter Integration Driver. This driver enables you to automate Flutter app testing in multiple programming languages, providing a powerful and flexible way to validate your Flutter apps on real devices in the cloud.

Testing Flutter apps requires embedding the Flutter Integration Server inside your app to enable communication between Appium and Flutter UI elements.

After preparing your Flutter app with this integration (refer to the setup documentation below), you can build, upload, and execute your tests on LambdaTest real devices using the Appium Flutter Integration Driver.


Native Flutter Integration Driver vs Appium Flutter Integration Driver Real Device Virtual Device

Feature / Use CaseNative Flutter DriverAppium Flutter Integration Driver
Writing tests in languages other than DartNoYes
Support for Flutter apps with embedded webviews or native viewsNoYes
Running tests on multiple devices simultaneouslyNoYes
Compatible with device farms supporting AppiumNoYes
Interaction beyond Flutter context (e.g., OTP apps)NoYes

Why Use Appium Flutter Integration Driver?

  • Multi-language support: Write tests in Java, Python, Ruby, JavaScript, and more.
  • Automatic UI synchronization: Waits intelligently for UI elements and animations to complete.
  • Seamless context switching: No manual switching between Flutter and native app contexts.
  • Powerful gesture support: Supports long press, drag and drop, scroll to element, double-click, and more.
  • Element chaining: Easily find child elements under specific parent widgets.
  • Real device cloud ready: Supported on LambdaTest real Android and iOS devices.

Getting Your Flutter App Ready for Testing

1. Add the Flutter Integration Server dependency

In your Flutter app’s pubspec.yaml, add:

dev_dependencies:
appium_flutter_server: 0.0.28

2. Create integration test files

Create an integration_test folder at the root of your Flutter project. Inside it, create appium_test.dart with:

import 'package:appium_flutter_server/appium_flutter_server.dart';
import 'package:your_app_package/main.dart'; // Replace with your app's main.dart import

void main() {
initializeTest(app: const MyApp());
}

Or with setup callback:

import 'package:your_app_package/main.dart' as app;

void main() {
initializeTest(
callback: (WidgetTester tester) async {
// Add prerequisite setup here
await tester.pumpWidget(const app.MyApp());
},
);
}

3. Build your Flutter app with integration test

./gradlew app:assembleDebug -Ptarget=$(pwd)/../integration_test/appium_test.dart

Uploading Your Flutter App to LambdaTest

  • For detailed instructions on how to upload your application to LambdaTest, please refer to our comprehensive guide.
  • Visit the Upload your Application documentation to learn more.
  • Use the returned App ID from above step in your automation scripts.

Sample Desired Capabilities Real Device Virtual Device

desired_caps = {
"deviceName":"Galaxy S20",
"platformName":"Android",
"platformVersion":"15",
"isRealMobile":True, // Use False for Virtual Devices
"app":"YOUR_APP_URL",
"build":"Sample Build",
"name":"Sample Test",
"automationName": "FlutterIntegration" #Using Flutter Integration Driver
}

tip
  • You must add the generated APP_URL to the app capability in the config file.
  • You must set isRealMobile capability to False in the config file to run on Virtual Devices
  • You can generate capabilities for your test requirements with the help of our inbuilt Capabilities Generator tool.For more details, please refer to our guide on Desired Capabilities in Appium.

Test across 3000+ combinations of browsers, real devices & OS.

Book Demo

Help and Support

Related Articles