Flutter App Automation

Hello,

It is my first time automating a Flutter Application in Katalon Studio and when running the recorder I am facing below issue:

java.util.concurrent.ExecutionException: org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: No observatory URL matching to ‘/(Observatory listening on |An Observatory debugger and profiler on\s.+\sis available at: |The Dart VM service is listening on )((http|\/\/)[a-zA-Z0-9:/=_\-.\[\]]+)/’ was found in the device log. Please make sure the application under test is configured properly according to GitHub - 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 and that it does not crash on startup.

Host info: host: ‘AK58283’, ip: ‘172.25.202.116’

Build info: version: ‘4.28.1’, revision: ‘73f5ad48a2’

System info: os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘17.0.14’

Driver info: io.appium.java_client.android.AndroidDriver

Command: [null, newSession {capabilities=[Capabilities {appium:app: C:\Users\Johann.SANTOS\Down…, appium:autoGrantPermissions: true, appium:automationName: Flutter, appium:deviceId: 53ac049b, appium:deviceName: OnePlus CPH2573 (Android 16), appium:fullReset: false, appium:newCommandTimeout: 1800, appium:noReset: true, appium:platformName: ANDROID, appium:platformVersion: 16, appium:systemPort: 61793, appium:udid: 53ac049b, platformName: ANDROID}]}]

Capabilities {appium:app: C:\Users\Johann.SANTOS\Down…, appium:autoGrantPermissions: true, appium:automationName: Flutter, appium:deviceId: 53ac049b, appium:deviceName: OnePlus CPH2573 (Android 16), appium:fullReset: false, appium:newCommandTimeout: 1800, appium:noReset: true, appium:platformName: ANDROID, appium:platformVersion: 16, appium:systemPort: 61793, appium:udid: 53ac049b, platformName: ANDROID}

at com.kms.katalon.composer.components.impl.dialogs.ProgressMonitorDialogWithThread.runAndWait(ProgressMonitorDialogWithThread.java:49)

at com.kms.katalon.composer.mobile.objectspy.components.MobileLocalAppComposite$12.run(MobileLocalAppComposite.java:491)

at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:124)

Caused by: org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: No observatory URL matching to ‘/(Observatory listening on |An Observatory debugger and profiler on\s.+\sis available at: |The Dart VM service is listening on )((http|\/\/)[a-zA-Z0-9:/=_\-.\[\]]+)/’ was found in the device log. Please make sure the application under test is configured properly according to GitHub - 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 and that it does not crash on startup.

Host info: host: ‘AK58283’, ip: ‘172.25.202.116’

Build info: version: ‘4.28.1’, revision: ‘73f5ad48a2’

System info: os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘17.0.14’

Driver info: io.appium.java_client.android.AndroidDriver

Command: [null, newSession {capabilities=[Capabilities {appium:app: C:\Users\Johann.SANTOS\Down…, appium:autoGrantPermissions: true, appium:automationName: Flutter, appium:deviceId: 53ac049b, appium:deviceName: OnePlus CPH2573 (Android 16), appium:fullReset: false, appium:newCommandTimeout: 1800, appium:noReset: true, appium:platformName: ANDROID, appium:platformVersion: 16, appium:systemPort: 61793, appium:udid: 53ac049b, platformName: ANDROID}]}]

Capabilities {appium:app: C:\Users\Johann.SANTOS\Down…, appium:autoGrantPermissions: true, appium:automationName: Flutter, appium:deviceId: 53ac049b, appium:deviceName: OnePlus CPH2573 (Android 16), appium:fullReset: false, appium:newCommandTimeout: 1800, appium:noReset: true, appium:platformName: ANDROID, appium:platformVersion: 16, appium:systemPort: 61793, appium:udid: 53ac049b, platformName: ANDROID}

at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:114)

at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:75)

at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:61)

at io.appium.java_client.remote.AppiumCommandExecutor.createSession(AppiumCommandExecutor.java:176)

at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:237)

at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:545)

at io.appium.java_client.AppiumDriver.startSession(AppiumDriver.java:270)

at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:174)

at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:91)

at io.appium.java_client.android.AndroidDriver.<init>(AndroidDriver.java:99)

at com.kms.katalon.core.appium.driver.AppiumDriverManager.createMobileDriver(AppiumDriverManager.java:598)

at com.kms.katalon.core.appium.driver.AppiumDriverManager.createMobileDriver(AppiumDriverManager.java:574)

at com.kms.katalon.core.mobile.keyword.internal.MobileDriverFactory.startLocalMobileDriver(MobileDriverFactory.java:600)

at com.kms.katalon.composer.mobile.objectspy.dialog.MobileInspectorController.startMobileApp(MobileInspectorController.java:207)

at com.kms.katalon.composer.mobile.objectspy.components.MobileLocalAppComposite.startLocalAppAsNormal(MobileLocalAppComposite.java:564)

at com.kms.katalon.composer.mobile.objectspy.components.MobileLocalAppComposite.smartStartAndroidApp(MobileLocalAppComposite.java:555)

at com.kms.katalon.composer.mobile.objectspy.components.MobileLocalAppComposite.smartStartApp(MobileLocalAppComposite.java:526)

at com.kms.katalon.composer.mobile.objectspy.components.MobileLocalAppComposite$12$1.call(MobileLocalAppComposite.java:497)

at com.kms.katalon.composer.components.impl.dialogs.ProgressMonitorDialogWithThread.startThreadAndWait(ProgressMonitorDialogWithThread.java:36)

at com.kms.katalon.composer.components.impl.dialogs.ProgressMonitorDialogWithThread.runAndWait(ProgressMonitorDialogWithThread.java:48)

... 2 more

2 Likes

hi @johann.santos

seems the environment setup on your machine is not complete yet
have you checked out this documentation? it covers setting up the environment for Flutter apps: Flutter App Test Automation: Guide to Katalon Studio

and don’t forget your Flutter application must be compiled in debug or profile mode also your Flutter app should enable the Flutter Driver Extension:

import 'package:flutter/material.dart';
import 'package:flutter_driver/driver_extension.dart';

main() {
  enableFlutterDriverExtension();
  runApp(ExampleApp());
}

learn more: GitHub - 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

along with the above, please try below if required

Check Appium and Appium-Flutter-Driver Installation

  • Confirm you have Appium and the Appium Flutter Driver plugin installed.
  • Make sure you’re using compatible Android/iOS versions as required by Appium-Flutter-Driver.

Run the App on a Device or Emulator Where Observatory Is Reachable

  • Sometimes physical devices or restricted emulators don’t allow the Observatory to start or be accessed.
  • Use a standard, unrestricted Android emulator for first-time setup.
1 Like

Flutter automation can be a bit tricky compared to standard mobile apps, so seeing a clear breakdown for it is really helpful. It’s one of those areas where the setup makes all the difference in getting things to run smoothly. This definitely clarifies a few things for anyone getting started with it.

Here are some more generic pointers which the automation guy should know if he/she is starting on flutter.

Here are some things that trip up almost everyone new to Flutter automation:

1. Flutter doesn’t use native UI components Since Flutter does not use native components, you need to define Key values on all your widgets to make them visible to the Appium Flutter Driver. Flutter app automate testing with Appium Flutter Driver - DEV Community
Work with your developers to ensure interactive widgets have ValueKey or Key assigned.

// Developer should add this to widgets
ElevatedButton(
  key: ValueKey('login_button'),
  ...
)

You can then find it in tests using byValueKey('login_button').

2. Use Flutter Inspector to find locators Flutter provides the Flutter Inspector tool that helps visually inspect and check widgets in your application. It simplifies locating the app’s interactable elements, and allows you to select any widget rendered by Flutter and copy its unique element locators like the accessibility_id. Flutter App Test Automation with Appium Flutter Driver - TestGrid

3. Context switching matters Flutter apps often have native overlays (permissions dialogs, webviews). You’ll need to switch contexts — use FLUTTER context for Flutter widgets and NATIVE_APP context for anything rendered natively.

4. Keyboard issues are a known bug Text entry in Flutter apps via Appium can behave unexpectedly. If keyboard input isn’t working, try setting flutter:setTextEntryEmulation to false in your capabilities and use native input instead.

5. iOS needs Profile mode (not Debug) Your Flutter app must be compiled in debug or profile mode. For iOS especially, it needs a profile build — previously it worked with debug builds but that changed. Appium 2.0 with appium flutter driver capabilities for IOS · appium/appium · Discussion #17273 · GitHub

6. Don’t test release builds — ever Appium’s Flutter Driver does not currently support apps built in release mode. Always ensure you’re working with a testable build, and keep a separate CI pipeline for producing debug/profile APKs for the QA team. Automated Flutter App Testing with Appium

I have even included some links of very good blogs regarding the flutter app automation

Could you please share the workaround or resolution if you had found already @johann.santos