Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebDriverError: An unknown server-side error occurred while processing the command. Original error: Cannot connect to the Dart Observatory URL ws://127.0.0.1:38609/eRfLNdN4XqY=/ws. #758

Open
ihzul opened this issue Dec 12, 2024 · 7 comments

Comments

@ihzul
Copy link

ihzul commented Dec 12, 2024

[e6d56334][AndroidUiautomator2Driver@de95] Matched '/status' to command name 'getStatus'
[e6d56334][AndroidUiautomator2Driver@de95] Proxying [GET /status] to [GET http://127.0.0.1:8214/status] with no body
[e6d56334][AndroidUiautomator2Driver@de95] Got response with status 200: {"sessionId":"None","value":{"message":"UiAutomator2 Server is ready to accept commands","ready":true}}
[e6d56334][AndroidUiautomator2Driver@de95] The initialization of the instrumentation process took 9227ms
[e6d56334][AndroidUiautomator2Driver@de95] Matched '/session' to command name 'createSession'
[e6d56334][AndroidUiautomator2Driver@de95] Proxying [POST /session] to [POST http://127.0.0.1:8214/session] with body: {"capabilities":{"firstMatch":[{"platformName":"Android","platformVersion":"15.0","deviceName":"emulator-5554","automationName":"Flutter","app":"/Users/ms/Documents/app-dev-debug.apk","noReset":false,"ensureWebviewsHavePages":true,"arguments":["--observatory-port=46595"],"platform":"LINUX","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"platformName":"Android","platformVersion":"15.0","deviceName":"emulator-5554","automationName":"Flutter","app":"/Users/ms/Documents/app-dev-debug.apk","noReset":false,"ensureWebviewsHavePages":true,"arguments":["--observatory-port=46595"]},"deviceUDID":"emulator-5554","appPackage":"com.dto.sehatindonesiaku.flutter.dev"}],"alwaysMatch":{}}}
[e6d56334][AndroidUiautomator2Driver@de95] Got response with status 200: {"sessionId":"67a48e81-661e-41e2-bb1d-ec9817b21511","value":{"capabilities":{"firstMatch":[{"platformName":"Android","platformVersion":"15.0","deviceName":"emulator-5554","automationName":"Flutter","app":"/Users/ms/Documents/app-dev-debug.apk","noReset":false,"ensureWebviewsHavePages":true,"arguments":["--observatory-port=46595"],"platform":"LINUX","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"platformName":"Android","platformVersion":"15.0","deviceName":"emulator-5554","automationName":"Flutter","app":"/Users/ms/Documents/app-dev-debug.apk","noReset":false,"ensureWebviewsHavePages":true,"arguments":["--observatory-port=46595"]},"deviceUDID":"emulator-5554","appPackage":"com.dto.sehatindonesiaku.flutter.dev"}],"alwaysMatch":{}},"sessionId":"67a48e81-661e-41e2-bb1d-ec9817b21511"}}
[e6d56334][AndroidUiautomator2Driver@de95] Determined the downstream protocol as 'W3C'
[e6d56334][AndroidUiautomator2Driver@de95] Proxying [GET /appium/device/pixel_ratio] to [GET http://127.0.0.1:8214/session/67a48e81-661e-41e2-bb1d-ec9817b21511/appium/device/pixel_ratio] with no body
[e6d56334][AndroidUiautomator2Driver@de95] Matched '/appium/device/system_bars' to command name 'getSystemBars'
[e6d56334][AndroidUiautomator2Driver@de95] Proxying [GET /appium/device/system_bars] to [GET http://127.0.0.1:8214/session/67a48e81-661e-41e2-bb1d-ec9817b21511/appium/device/system_bars] with no body
[e6d56334][AndroidUiautomator2Driver@de95] Matched '/window/current/size' to command name 'getWindowSize'
[e6d56334][AndroidUiautomator2Driver@de95] Proxying [GET /window/current/size] to [GET http://127.0.0.1:8214/session/67a48e81-661e-41e2-bb1d-ec9817b21511/window/current/size] with no body
[e6d56334][AndroidUiautomator2Driver@de95] Proxying [GET /appium/device/info] to [GET http://127.0.0.1:8214/session/67a48e81-661e-41e2-bb1d-ec9817b21511/appium/device/info] with no body
[e6d56334][ADB] Running '/Users/ms/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell dumpsys window'
[e6d56334][ADB] Running '/Users/ms/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell dumpsys power'
[e6d56334][AndroidUiautomator2Driver@de95] Got response with status 200: {"sessionId":"67a48e81-661e-41e2-bb1d-ec9817b21511","value":2.625}
[e6d56334][AndroidUiautomator2Driver@de95] Got response with status 200: {"sessionId":"67a48e81-661e-41e2-bb1d-ec9817b21511","value":{"statusBar":63}}
[e6d56334][AndroidUiautomator2Driver@de95] Got response with status 200: {"sessionId":"67a48e81-661e-41e2-bb1d-ec9817b21511","value":{"height":2400,"width":1080}}
[e6d56334][AndroidUiautomator2Driver@de95] Got response with status 200: {"sessionId":"67a48e81-661e-41e2-bb1d-ec9817b21511","value":{"androidId":"83625c92ae2f71e8","apiVersion":"35","bluetooth":{"state":"ON"},"brand":"google","carrierName":"T-Mobile","displayDensity":420,"locale":"en_US","manufacturer":"Google","model":"sdk_gphone64_x86_64","networks":[{"capabilities":{"SSID":null,"linkDownBandwidthKbps":30000,"linkUpstreamBandwidthKbps":12000,"networkCapabilities":"NET_CAPABILITY_NOT_METERED,NET_CAPABILITY_INTERNET,NET_CAPABILITY_NOT_RESTRICTED,NET_CAPABILITY_TRUSTED,NET_CAPABILITY_NOT_VPN,NET_CAPABILITY_VALIDATED,NET_CAPABILITY_NOT_ROAMING,NET_CAPABILITY_FOREGROUND,NET_CAPABILITY_NOT_CONGESTED,NET_CAPABILITY_NOT_SUSPENDED","signalStrength":-50,"transportTypes":"TRANSPORT_WIFI"},"detailedState":"CONNECTED","extraInfo":"","isAvailable":true,"isConnected":true,"isFailover":false,"isRoaming":false,"state":"CONNECTED","subtype":-1,"subtypeName":"","type":1,"typeName":"WIFI"},{"capabilities":{"SSID":null,"linkDownBandwidthKbps":4300,"linkUpstreamBandwidthKbps":1800,"networkCapabil...
[e6d56334][AndroidUiautomator2Driver@de95] Screen already unlocked, doing nothing
[e6d56334][AndroidUiautomator2Driver@de95] Starting 'com.dto.sehatindonesiaku.flutter.dev/com.dto.sehatindonesiaku.MainActivity and waiting for 'com.dto.sehatindonesiaku.flutter.dev/com.dto.sehatindonesiaku.MainActivity'
[e6d56334][ADB] Running '/Users/ms/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell am start-activity -W -n com.dto.sehatindonesiaku.flutter.dev/com.dto.sehatindonesiaku.MainActivity -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000'
[e6d56334][FlutterDriver@88b0] Matched the syslog line '12-12 14:44:48.149 13044 13098 I flutter : The Dart VM service is listening on http://127.0.0.1:38609/eRfLNdN4XqY=/'
[e6d56334][ADB] Waiting up to 20000ms for activity matching pkg: 'com.dto.sehatindonesiaku.flutter.dev' and activity: 'com.dto.sehatindonesiaku.MainActivity' to be focused
[e6d56334][ADB] Possible activities, to be checked: 'com.dto.sehatindonesiaku.MainActivity', 'com.dto.sehatindonesiaku.flutter.dev.com.dto.sehatindonesiaku.MainActivity'
[e6d56334][ADB] Getting focused package and activity
[e6d56334][ADB] Running '/Users/ms/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell dumpsys window displays'
[e6d56334][ADB] Found package: 'com.dto.sehatindonesiaku.flutter.dev' and fully qualified activity name : 'com.dto.sehatindonesiaku.MainActivity'
[e6d56334][ADB] Forwarding system: 38609 to device: 38609
[e6d56334][ADB] Running '/Users/ms/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 forward tcp:38609 tcp:38609'
[e6d56334][FlutterDriver@88b0] Establishing a connection to the Dart Observatory
[e6d56334][FlutterDriver@88b0] Connecting to Dart Observatory: ws://127.0.0.1:38609/eRfLNdN4XqY=/ws
[e6d56334][FlutterDriver@88b0] Listing all isolates: [{"type":"@isolate","id":"isolates/4500330911550351","name":"main","number":"4500330911550351","isSystemIsolate":false,"isolateGroupId":"isolateGroups/2586300655368564"}]
[e6d56334][FlutterDriver@88b0] "ext.flutter.driver" is not found in "extensionRPCs" ["ext.ui.window.scheduleFrame","ext.ui.window.reinitializeShader","ext.ui.window.impellerEnabled","ext.dart.io.httpEnableTimelineLogging","ext.dart.io.getSocketProfile","ext.dart.io.socketProfilingEnabled","ext.dart.io.clearSocketProfile","ext.dart.io.getVersion","ext.dart.io.getHttpProfile","ext.dart.io.getHttpProfileRequest","ext.dart.io.clearHttpProfile","ext.flutter.reassemble","ext.flutter.exit","ext.flutter.connectedVmServiceUri","ext.flutter.activeDevToolsServerAddress","ext.flutter.platformOverride","ext.flutter.brightnessOverride","ext.flutter.timeDilation","ext.flutter.evict","ext.flutter.profilePlatformChannels","ext.flutter.invertOversizedImages","ext.flutter.debugPaint","ext.flutter.debugPaintBaselinesEnabled","ext.flutter.repaintRainbow","ext.flutter.debugDumpLayerTree","ext.flutter.debugDisableClipLayers","ext.flutter.debugDisablePhysicalShapeLayers","ext.flutter.debugDisableOpacityLayers","ext.flutter.debugDumpRenderTree","ext.flutter.debugDumpSemanticsTreeInTraversalOrder","ext.flutter.debugDumpSemanticsTreeInInverseHitTestOrder","ext.flutter.profileRenderObjectPaints","ext.flutter.profileRenderObjectLayouts","ext.flutter.debugDumpApp","ext.flutter.debugDumpFocusTree","ext.flutter.showPerformanceOverlay","ext.flutter.didSendFirstFrameEvent","ext.flutter.didSendFirstFrameRasterizedEvent","ext.flutter.profileWidgetBuilds","ext.flutter.profileUserWidgetBuilds","ext.flutter.debugAllowBanner","ext.flutter.inspector.structuredErrors","ext.flutter.inspector.show","ext.flutter.inspector.trackRebuildDirtyWidgets","ext.flutter.inspector.widgetLocationIdMap","ext.flutter.inspector.trackRepaintWidgets","ext.flutter.inspector.disposeAllGroups","ext.flutter.inspector.disposeGroup","ext.flutter.inspector.isWidgetTreeReady","ext.flutter.inspector.disposeId","ext.flutter.inspector.setPubRootDirectories","ext.flutter.inspector.addPubRootDirectories","ext.flutter.inspector.removePubRootDirectories","ext.flutter.inspector.getPubRootDirectories","ext.flutter.inspector.setSelectionById","ext.flutter.inspector.getParentChain","ext.flutter.inspector.getProperties","ext.flutter.inspector.getChildren","ext.flutter.inspector.getChildrenSummaryTree","ext.flutter.inspector.getChildrenDetailsSubtree","ext.flutter.inspector.getRootWidget","ext.flutter.inspector.getRootWidgetSummaryTree","ext.flutter.inspector.getRootWidgetSummaryTreeWithPreviews","ext.flutter.inspector.getRootWidgetTree","ext.flutter.inspector.getDetailsSubtree","ext.flutter.inspector.getSelectedWidget","ext.flutter.inspector.getSelectedSummaryWidget","ext.flutter.inspector.isWidgetCreationTracked","ext.flutter.inspector.screenshot","ext.flutter.inspector.getLayoutExplorerNode","ext.flutter.inspector.setFlexFit","ext.flutter.inspector.setFlexFactor","ext.flutter.inspector.setFlexProperties"]
[e6d56334][FlutterDriver@88b0] Deleting Flutter Driver session
[e6d56334][FlutterDriver@88b0] Cleanup the port forward
[e6d56334][AppiumDriver@208b] Event 'newSessionStarted' logged at 1733989497221 (14:44:57 GMT+0700 (Western Indonesia Time))
[e6d56334][AppiumDriver@208b] Encountered internal error running command: Error: Cannot connect to the Dart Observatory URL ws://127.0.0.1:38609/eRfLNdN4XqY=/ws. Check the server log for more details
at FlutterDriver.connectSocket (/Users/ms/Documents/repeository/Latihan/ANDORID_AUTOMATION/node_modules/appium-flutter-driver/lib/sessions/observatory.ts:125:9)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at FlutterDriver.connectAndroidSession (/Users/ms/Documents/repeository/Latihan/ANDORID_AUTOMATION/node_modules/appium-flutter-driver/lib/sessions/android.ts:49:10)
at FlutterDriver.startAndroidSession (/Users/ms/Documents/repeository/Latihan/ANDORID_AUTOMATION/node_modules/appium-flutter-driver/lib/sessions/android.ts:38:5)
at FlutterDriver.createSession (/Users/ms/Documents/repeository/Latihan/ANDORID_AUTOMATION/node_modules/appium-flutter-driver/lib/sessions/session.ts:45:43)
at AppiumDriver.createSession (/Users/ms/Documents/repeository/Latihan/ANDORID_AUTOMATION/node_modules/appium/lib/appium.js:740:35)
[e6d56334][HTTP] <-- POST /session 500 28329 ms - 784

LOG issue:

[e6d56334][FlutterDriver@88b0] "ext.flutter.driver" is not found in "extension...

@ihzul
Copy link
Author

ihzul commented Dec 12, 2024

exports.config = {
runner: 'local',
path: '/', ]
port: 4723, // Port Appium
specs: [
'./test/specs/**/*.js',
capabilities: [{
platformName: 'Android',
'appium:platformVersion': '15.0',
'appium:deviceName': 'emulator-5554',
'appium:automationName': 'Flutter',
'appium:app': '/Users/ms/Documents/app-dev-debug.apk',
'appium:noReset': false,
'appium:ensureWebviewsHavePages': true,
'appium:arguments': ['--observatory-port=46595'],
}],
logLevel: 'trace',
waitforTimeout: 10000,
connectionRetryTimeout: 120000,
connectionRetryCount: 2,
framework: 'mocha',
mochaOpts: {
ui: 'bdd',
timeout: 60000,
},
onPrepare: function (config, capabilities) {
console.log('Starting Appium tests...');
},
beforeSession: function (config, capabilities) {
console.log('Verifying emulator/device...');
const execSync = require('child_process').execSync;
const devices = execSync('adb devices').toString();
if (!devices.includes('emulator-5554')) {
throw new Error('Emulator emulator-5554 is not running. Please start the emulator.');
}
},
};

@ihzul
Copy link
Author

ihzul commented Dec 12, 2024

main dart.

import 'package:core/core.dart';
import 'package:core/helpers/hive/hive_helper.dart' as hivehelper;
import 'package:core/helpers/messaging/messaging.dart';
import 'package:core/resources/injector/injection_container.dart' as injector;
import 'package:datadog_flutter_plugin/datadog_flutter_plugin.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:sehatindonesiaku/firebase_options_dev.dart';
import 'package:sehatindonesiaku/main.dart';
import 'package:flutter_driver/driver_extension.dart';

void main() async {
enableFlutterDriverExtension();
WidgetsFlutterBinding.ensureInitialized();
// region Firebase
await Messaging.instance.initializeApp(
options: DefaultFirebaseOptions.currentPlatform,
topic: FlavorType.dev.topic,
);
// endregion Firebase

// region package info
initPlatformState();
// endregion package info

// region flavor config
FlavorConfig(
flavor: FlavorType.dev,
color: Colors.red,
appName: r'ASIK DEV',
serverAsik: baseUrlAsikDev,
serverAsikGrafikWHO: baseUrlAsikGrafikWHODev,
serverSatSet: baseUrlSatSetDev,
serverSatSetAuth: baseUrlSatSetAuth,
serverSatSetConsent: baseUrlSatSetConsentDev,
serverSehatIndonesiaku: baseUrlSehatIndonesiaDev,
serverIlp: baseUrlIlpDev,
serverDashboardGenerator: baseUrlDashboardGeneratorDev,
serverPeople: baseUrlPeopleDev,
values: const FlavorValues(
titleApp: r'Sehat Indonesiaku Dev',
flavorApp: r'Development',
),
);
// endregion flavor config

injector.init();
initFirebase();
await hivehelper.initHive();

// region Notification
initializeNotifications();
// endregion Notification

SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]).then(
(value) async => !kDebugMode
? await DatadogSdk.runApp(
dataDogConfiguration,
TrackingConsent.granted,
() => runApp(const MainApp()),
)
: runApp(const MainApp()),
);
}

@ihzul
Copy link
Author

ihzul commented Dec 12, 2024

My pubspec.yaml

dev_dependencies:
flutter_driver:
sdk: flutter
flutter_test:
sdk: flutter

@ihzul
Copy link
Author

ihzul commented Dec 12, 2024

Screenshot 2024-12-12 at 15 18 00

@ihzul
Copy link
Author

ihzul commented Dec 12, 2024

Screenshot 2024-12-12 at 15 26 43

@KazuCocoa
Copy link
Member

Did you see the device log? Like #756 (comment) , device log may tell more hints

@ihzul
Copy link
Author

ihzul commented Dec 16, 2024

I'll try it first, hopefully it works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants