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.