question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Appium log hangs forever when it gets to `Executing Flutter driver command 'click'`

See original GitHub issue

Appium log hangs forever when it gets to Executing Flutter driver command 'click'.

The app launches fine. Then the last two lines I see are:

[debug] [FlutterDriver] Executing Flutter driver command 'click' [debug] [FlutterDriver] >>> {"command":"tap","finderType":"ByValueKey","keyValueString":"contact-button","keyValueType":"String"}

Below is the appium log from the point where flutter driver is first mentioned. I could post the entire log.

Does this mean…

  • the element cannot be found?
  • there’s something wrong with the setup?
  • something else?

At the moment, I am quite clueless as to how to troubleshoot this.

[debug] [FlutterDriver] /Users/liamharris/Library/Android/sdk/platform-tools/adb -s emulator-5554 forward tcp:46427 tcp:46427
[FlutterDriver] Attempt #1
[FlutterDriver] Connecting to Dart Observatory: ws://127.0.0.1:46427/gY6q1iZE0u8=/ws
[FlutterDriver] Connected to ws://127.0.0.1:46427/gY6q1iZE0u8=/ws
[FlutterDriver] Listing all isolates: [{"type":"@Isolate","id":"isolates/1851195815643283","name":"main","number":"1851195815643283","isSystemIsolate":false}]
[FlutterDriver] "ext.flutter.driver" is not found in "extensionRPCs" ["ext.ui.window.scheduleFrame","ext.dart.io.getHttpEnableTimelineLogging","ext.dart.io.setHttpEnableTimelineLogging","ext.dart.io.httpEnableTimelineLogging","ext.dart.io.getSocketProfile","ext.dart.io.startSocketProfiling","ext.dart.io.pauseSocketProfiling","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.platformOverride","ext.flutter.brightnessOverride","ext.flutter.connectedVmServiceUri","ext.flutter.activeDevToolsServerAddress","ext.flutter.timeDilation","ext.flutter.evict","ext.flutter.invertOversizedImages","ext.flutter.debugPaint","ext.flutter.debugPaintBaselinesEnabled","ext.flutter.repaintRainbow","ext.flutter.debugCheckElevationsEnabled","ext.flutter.debugDumpLayerTree","ext.flutter.debugDumpRenderTree","ext.flutter.debugDumpSemanticsTreeInTraversalOrder","ext.flutter.debugDumpSemanticsTreeInInverseHitTestOrder","ext.flutter.debugDumpApp","ext.flutter.showPerformanceOverlay","ext.flutter.didSendFirstFrameEvent","ext.flutter.didSendFirstFrameRasterizedEvent","ext.flutter.fastReassemble","ext.flutter.profileWidgetBuilds","ext.flutter.debugAllowBanner","ext.flutter.debugWidgetInspector"]
[FlutterDriver] Waiting 300 seconds before trying...
[FlutterDriver] Attempt #2
[FlutterDriver] Connecting to Dart Observatory: ws://127.0.0.1:46427/gY6q1iZE0u8=/ws
[FlutterDriver] Connected to ws://127.0.0.1:46427/gY6q1iZE0u8=/ws
[FlutterDriver] Listing all isolates: [{"type":"@Isolate","id":"isolates/1851195815643283","name":"main","number":"1851195815643283","isSystemIsolate":false}]
[Appium] New FlutterDriver session created successfully, session e57475b6-a658-4457-bb90-03aa62bed580 added to master session list
[debug] [BaseDriver] Event 'newSessionStarted' logged at 1630690650505 (19:37:30 GMT+0200 (Central European Summer Time))
[debug] [MJSONWP (e57475b6)] Cached the protocol value 'MJSONWP' for the new session e57475b6-a658-4457-bb90-03aa62bed580
[debug] [MJSONWP (e57475b6)] Responding to client with driver.createSession() result: {"shell":false,"allowCors":false,"reboot":false,"ipa":null,"address":"0.0.0.0","port":4723,"basePath":"/wd/hub","keepAliveTimeout":null,"callbackAddress":null,"callbackPort":null,"bootstrapPort":4724,"backendRetries":3,"sessionOverride":false,"launch":false,"logFile":null,"loglevel":"debug","logTimestamp":false,"localTimezone":false,"logNoColors":false,"webhook":null,"safari":false,"defaultDevice":false,"forceIphone":false,"forceIpad":false,"automationTraceTemplatePath":null,"instrumentsPath":null,"nodeconfig":null,"robotAddress":"0.0.0.0","robotPort":-1,"chromedriverExecutable":null,"showConfig":false,"noPermsCheck":false,"enforceStrictCaps":false,"isolateSimDevice":false,"tmpDir":"/var/folders/nm/1rsxlpr13h99w167fps7q95m0000gn/T","traceDir":null,"debugLogSpacing":false,"suppressKillServer":false,"longStacktrace":false,"webkitDebugProxyPort":27753,"wdaLocalPort":8100,"defaultCapabilities":{},"relaxedSecurityEnabled":false,"allowInsecure":[],"denyInsecure":[],"defaultCommandTimeout":60,"keepArtifacts":fals...
[HTTP] <-- POST /wd/hub/session 200 321680 ms - 2121
[HTTP] 
[HTTP] --> POST /wd/hub/session/e57475b6-a658-4457-bb90-03aa62bed580/element/eyJmaW5kZXJUeXBlIjoiQnlWYWx1ZUtleSIsImtleVZhbHVlU3RyaW5nIjoiY29udGFjdC1idXR0b24iLCJrZXlWYWx1ZVR5cGUiOiJTdHJpbmcifQ==/click
[HTTP] {"id":"eyJmaW5kZXJUeXBlIjoiQnlWYWx1ZUtleSIsImtleVZhbHVlU3RyaW5nIjoiY29udGFjdC1idXR0b24iLCJrZXlWYWx1ZVR5cGUiOiJTdHJpbmcifQ==","sessionId":"e57475b6-a658-4457-bb90-03aa62bed580"}
[debug] [MJSONWP (e57475b6)] Calling AppiumDriver.click() with args: ["eyJmaW5kZXJUeXBlIjoiQnlWYWx1ZUtleSIsImtleVZhbHVlU3RyaW5nIjoiY29udGFjdC1idXR0b24iLCJrZXlWYWx1ZVR5cGUiOiJTdHJpbmcifQ==","e57475b6-a658-4457-bb90-03aa62bed580"]
[debug] [FlutterDriver] Executing Flutter driver command 'click'
[debug] [FlutterDriver] >>> {"command":"tap","finderType":"ByValueKey","keyValueString":"contact-button","keyValueType":"String"}

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
arctouch-thiagowernercommented, Nov 22, 2022

I solved this problem and identified the root cause.

By default, Flutter Driver waits until there is no pending frame scheduled in the app under test before executing an action. Because of this, some interactions such as click() may not work properly. To counter it, we use setFrameSync() function before and after the desired action.

So with that, the code would be:

    def tap_element(self, element: Element):
        self.driver.execute_script('flutter:setFrameSync', True, 5000)
        self.find(element).click()
        self.driver.execute_script('flutter:setFrameSync', False, 5000)
0reactions
KazuCocoacommented, Nov 22, 2022

This behavior seems to be coming inside DartVM/Flutter. Close as not in this driver itself.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Appium Flutter Driver is not finding/clicking element after grant ...
I got following issue: I'm trying to automate app wrote in flutter using appium-flutter-driver and app requests permissions for:
Read more >
Implicit Wait - Appium
When searching for a single element, the driver should poll the page until an element is found or the timeout expires, whichever occurs...
Read more >
Common Error Messages | Sauce Labs Documentation
You'll see this error when Sauce Labs doesn't receive a response from Selenium or Appium to your script's last command in more than...
Read more >
Part 6 - Identifying UI element in flutter app with Flutter Inspector
Flutter Driver automation testing ... [Flutter Gherkin: Gherkin + Runner for ... To follow execute automation on linkedIn group, ...
Read more >
appium/appium - Gitter
im not able to run my automation test on api 29 android 10 ... I am trying to automate a flutter app with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found