Coder Social home page Coder Social logo

robotframework-appiumflutterlibrary's Introduction

AppiumFlutterLibrary

Latest PyPI version Number of PyPI downloads

AppiumFlutterLibrary is a library for testing Flutter apps with Robot Framework.

The project uses the FlutterDriver test tools integrated to Appium as a Robot Framework library.

Installation

The recommended installation method is using pip:

pip install --upgrade robotframework-appiumflutterlibrary

See Robot Framework installation instructions for detailed information about installing Python and Robot Framework itself.

Keyword documentation

AppiumFlutterLibrary has a complete Keyword Documentation.

Flutter setup

To use AppiumFlutterLibrary you will need to make a simple setup in your Flutter project.

At first, include flutter_driver package to your dev dependencies at pubspec.yaml:

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

Then go to your main.dart file and add enableFlutterDriverExtension() to your main function before runApp()

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

void main() {
  enableFlutterDriverExtension();
  runApp(const MyApp());
}

...

robotframework-appiumflutterlibrary's People

Contributors

igortavtib avatar paimvictor avatar rodaxfck avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

robotframework-appiumflutterlibrary's Issues

No Capture Page Screenshot when failure

Hi,

There is no "Capture Page Screenshot" taken by default when a keyword is FAIL.

Failed test case
    Open Application 	http://localhost:4723/wd/hub 	automationName=flutter    platformName=Android    platformVersion=10    deviceName=device    appPackage=dev.flutter.formApp.form_app    appActivity=dev.flutter.formApp.form_app.MainActivity
    Set Log Level    TRACE
    Run Keyword And Continue On Failure    Wait For Element    blabla    15
    Run Keyword And Continue On Failure    Element Should Be Visible    blabla
    Run Keyword And Continue On Failure    Click Element    blabla
    [Teardown]    Close All Applications

Here is my log.html file : https://optimistic-brattain-abf395.netlify.app/
Don't forget to put report log level to "TRACE" on html page

( I see also test hangs for 2 minutes when a locator is not found for "Click Element".
I think it's related to this issue on appium-flutter-driver side : appium/appium-flutter-driver#181 )

Library fails to open the app on Android emulator

Hello There,
I Installed Appium, appium-flutter-driver, robot and this library, and I was unable to make the app work.
I keep getting the following error:

AttributeError: 'NoneType' object has no attribute 'to_capabilities'

Merge with original project?

Hello all!

Just wondering here, is it possible to merge this project with the original one?
It would be great if we could use the same library for flutter and native.

Swipe right and left

Hi,

Thanks for the library, it made it possible to automate our flutter app tests !
We managed to convert our tests to the Flutter driver almost fine.

Only thing remaining so far is the swipe feature, especially horizontally.
Unfortunately, scroll keywords cannot help. As we want to swipe left and right.

Any thoughts, workarounds ?

[Help Request] How can we user Appium switch context function

Hi all,
I need to use switch flutter driver to UiAutomator2, Is it possible with this library ?
It would be very helpfull for hybrid applications and using ui automator 2 functions . Also we can support our tests with Ocr library with uiautomator2.

Could we interact with Xpath?

I have to testing with old Flutter app, developers are not supported, element may not have ValueKey, Text...
So is there a way to interact with Xpath ?

Key locator usage

Hi, First of all thank for this project,
I am new on RobotFrameWork usage, I can't find that how can ı define key locator on keywords by this library
Could you please share test example about key locator.

I tried these syntax :

  • Click Element key=skip_button
  • Wait For Element key=skip_button 10s

Thanks for support in advance

Encountered internal error running command: Error: input is invalid

Hi
When I started the test, the app is running and driver returns error that input error on following keyword. Altough I tried Wait For Element and absent option the driver doesnt wait the element and it returns input error immediately (I use default timeout but I tried with setting it manually).

*** Keywords ***
Click skip button on onboard
[Documentation] Skip onboard Screen
Wait For Element Absent ${SkipButton}

Test Teardown End The test applications

*** Test Cases ***
Onboard Screen test demo - desc
Open Android Test App
Click skip button on onboard

Onboard Screen test title - desc | FAIL |
Element 'skip_button' still not absent in 20 seconds

[HTTP] --> POST /session/e8346d4b-a7cd-44fe-b32d-2704cc6b4921/execute/sync [HTTP] {"script":"flutter:waitForAbsent","args":[{"element-6066-11e4-a52e-4f735466cecf":"eyJmaW5kZXJUeXBlIjoiQnlWYWx1ZUtleSIsImtleVZhbHVlU3RyaW5nIjoic2tpcF9idXR0b24iLCJrZXlWYWx1ZVR5cGUiOiJTdHJpbmcifQ=="},20]} [debug] [FlutterDriver@5bda (e8346d4b)] Calling AppiumDriver.execute() with args: ["flutter:waitForAbsent",[{"element-6066-11e4-a52e-4f735466cecf":"eyJmaW5kZXJUeXBlIjoiQnlWYWx1ZUtleSIsImtleVZhbHVlU3RyaW5nIjoic2tpcF9idXR0b24iLCJrZXlWYWx1ZVR5cGUiOiJTdHJpbmcifQ=="},20],"e8346d4b-a7cd-44fe-b32d-2704cc6b4921"] [debug] [FlutterDriver] Executing Flutter driver command 'execute' [debug] [FlutterDriver@5bda (e8346d4b)] Encountered internal error running command: Error: input is invalid {"element-6066-11e4-a52e-4f735466cecf":"eyJmaW5kZXJUeXBlIjoiQnlWYWx1ZUtleSIsImtleVZhbHVlU3RyaW5nIjoic2tpcF9idXR0b24iLCJrZXlWYWx1ZVR5cGUiOiJTdHJpbmcifQ=="} [debug] [FlutterDriver@5bda (e8346d4b)] at decode (/Users/yahya.kara/.appium/node_modules/finder/nodejs/lib/base64url.ts:15:11) [debug] [FlutterDriver@5bda (e8346d4b)] at deserialize (/Users/yahya.kara/.appium/node_modules/finder/nodejs/lib/deserializer.ts:4:20) [debug] [FlutterDriver@5bda (e8346d4b)] at FlutterDriver.executeElementCommand (/Users/yahya.kara/.appium/node_modules/appium-flutter-driver/lib/sessions/observatory.ts:172:52) [debug] [FlutterDriver@5bda (e8346d4b)] at /Users/yahya.kara/.appium/node_modules/appium-flutter-driver/lib/commands/execute/wait.ts:20:14 [debug] [FlutterDriver@5bda (e8346d4b)] at FlutterDriver.execute (/Users/yahya.kara/.appium/node_modules/appium-flutter-driver/lib/commands/execute.ts:48:27) [debug] [FlutterDriver@5bda (e8346d4b)] at commandExecutor (/usr/local/lib/node_modules/appium/node_modules/@appium/base-driver/lib/basedriver/driver.js:73:9) [debug] [FlutterDriver@5bda (e8346d4b)] at /usr/local/lib/node_modules/appium/node_modules/async-lock/lib/index.js:154:12 [debug] [FlutterDriver@5bda (e8346d4b)] at AsyncLock._promiseTry (/usr/local/lib/node_modules/appium/node_modules/async-lock/lib/index.js:287:31) [debug] [FlutterDriver@5bda (e8346d4b)] at exec (/usr/local/lib/node_modules/appium/node_modules/async-lock/lib/index.js:153:9) [debug] [FlutterDriver@5bda (e8346d4b)] at AsyncLock.acquire (/usr/local/lib/node_modules/appium/node_modules/async-lock/lib/index.js:170:3) [debug] [FlutterDriver@5bda (e8346d4b)] at FlutterDriver.executeCommand (/usr/local/lib/node_modules/appium/node_modules/@appium/base-driver/lib/basedriver/driver.js:89:39) [debug] [FlutterDriver@5bda (e8346d4b)] at runMicrotasks (<anonymous>) [debug] [FlutterDriver@5bda (e8346d4b)] at processTicksAndRejections (node:internal/process/task_queues:96:5) [debug] [FlutterDriver@5bda (e8346d4b)] at FlutterDriver.executeCommand (/Users/yahya.kara/.appium/node_modules/appium-flutter-driver/lib/driver.ts:139:16) [debug] [FlutterDriver@5bda (e8346d4b)] at defaultBehavior (/usr/local/lib/node_modules/appium/lib/appium.js:673:14) [debug] [FlutterDriver@5bda (e8346d4b)] at AppiumDriver.executeWrappedCommand (/usr/local/lib/node_modules/appium/lib/appium.js:763:16) [debug] [FlutterDriver@5bda (e8346d4b)] at AppiumDriver.executeCommand (/usr/local/lib/node_modules/appium/lib/appium.js:685:17) [debug] [FlutterDriver@5bda (e8346d4b)] at asyncHandler (/usr/local/lib/node_modules/appium/node_modules/@appium/base-driver/lib/protocol/protocol.js:346:19)

I am using Appium 2.0 and robotframework-appiumflutterlibrary 1.0.0b2

Thank for your helps

scroll to element issue

HI Team
The scroll element function does not support the listView ,because it's used the flutter driver function:scrollIntoView , but it's not used when the element is listView , I tried to use scrollUntilVisible instead in your python lib :

code:

def scroll_listView(self,ele_locator):
application = self._current_application()
list_view = self._element_finder.find(application,"type=ListView")
element = self._element_finder.find(application, ele_locator)
print(list_view)
print(element)
application.execute_script('flutter:scrollUntilVisible',list_view, {"item":element, "dxScroll": 90, "dyScroll": -400})

but it's not working as error below:

error details :

WebDriverException: Message: An unknown server-side error occurred while processing the command. Original error: input is invalid {"element-6066-11e4-a52e-4f735466cecf":"eyJmaW5kZXJUeXBlIjoiQnlUeXBlIiwidHlwZSI6Ikxpc3RWaWV3In0="}
Stacktrace:
UnknownError: An unknown server-side error occurred while processing the command. Original error: input is invalid {"element-6066-11e4-a52e-4f735466cecf":"eyJmaW5kZXJUeXBlIjoiQnlUeXBlIiwidHlwZSI6Ikxpc3RWaWV3In0="}
at getResponseForW3CError (/opt/homebrew/lib/node_modules/appium/node_modules/@appium/base-driver/lib/protocol/errors.js:1067:9)
at asyncHandler (/opt/homebrew/lib/node_modules/appium/node_modules/@appium/base-driver/lib/protocol/protocol.js:476:57)
at runNextTicks (node:internal/process/task_queues:60:5)
at processImmediate (node:internal/timers:442:9)

could you help this ??

Help intergrate with robot Framework

Hi Igortavtib,

Could you make more detail about how Appium Flutter Driver working ?
I already add :
At first, include flutter_driver package to your dev dependencies at pubspec.yaml:

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

Then go to your main.dart file and add enableFlutterDriverExtension() to your main function before runApp()

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

void main() {
enableFlutterDriverExtension();
runApp(const MyApp());
}

...

but I still couldn't start Flutter application and don't know how to get element location.
Please make a video demo for us understant how driver work.

Thank you!

|Help Request| How can we get element chain

Hi thanks for this libary helps us to automate mobile application tests, Could you help me to know how can get element chan for example :
------key:element_1
----------key:sub_element
------key:element_2
----------key:sub_element
I need to know how can I pick the sub element of element_1

Should I change the key value pattern and change their value as "element". If I change the value parent Can Is there any method to use for getting elements by index ?

Thanks a lot in advance

Appium 2.0 Press KeyCode event doesn't work

When I use the Press KeyCode event, the driver trow following error on Appium 2.0.

WebDriverException: Message: Method has not yet been implemented
Stacktrace:
NotYetImplementedError: Method has not yet been implemented
at FlutterDriver.executeCommand (/Users/yahya.kara/.appium/node_modules/@appium/base-driver/lib/basedriver/driver.js:67:13)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at FlutterDriver.executeCommand (/Users/yahya.kara/.appium/node_modules/appium-flutter-driver/lib/driver.ts:139:16)
at defaultBehavior (/usr/local/lib/node_modules/appium/lib/appium.js:673:14)
at AppiumDriver.executeWrappedCommand (/usr/local/lib/node_modules/appium/lib/appium.js:763:16)
at AppiumDriver.executeCommand (/usr/local/lib/node_modules/appium/lib/appium.js:685:17)
at asyncHandler (/usr/local/lib/node_modules/appium/node_modules/@appium/base-driver/lib/protocol/protocol.js:346:19)

Could you help me about How can I use the press key code keyword

Error : Failed to connect 30 times. Aborting

Appium - 2.1.0
Flutter - 3.10.6
Dart - 3.0.6
appium-flutter-driver - 1.14.0
robotframework - 6.1.1
robotframework-appiumflutterlibrary - 1.0.0
Appium-Flutter-Finder - 0.4.0

I got this error since update appium 2 and flutter 3. It was work well when I use appium 1.
I try downgrade appium, but didn't work.
If I use appiumlibrary, automation and appium work well.

this from robotframework log.html
WebDriverException: Message: An unknown server-side error occurred while processing the command. Original error: Failed to connect 30 times. Aborting. Stacktrace: UnknownError: An unknown server-side error occurred while processing the command. Original error: Failed to connect 30 times. Aborting. at getResponseForW3CError (C:\Users\IDN MEDIA\AppData\Roaming\npm\node_modules\appium\node_modules\@appium\base-driver\lib\protocol\errors.js:1073:9) at asyncHandler (C:\Users\IDN MEDIA\AppData\Roaming\npm\node_modules\appium\node_modules\@appium\base-driver\lib\protocol\protocol.js:491:57)

this from appium log
[FlutterDriver] Attempt #29
[ADB] Using 'adb.exe' from 'C:\Users\IDN MEDIA\AppData\Local\Android\Sdk\platform-tools\adb.exe'
[debug] [ADB] Running 'C:\Users\IDN MEDIA\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 start-server'
[AndroidDriver] Retrieving device list
[debug] [ADB] Trying to find a connected android device
[debug] [ADB] Getting connected devices
[debug] [ADB] Connected devices: [{"udid":"emulator-5554","state":"device"}]
[AndroidDriver] Looking for a device with Android '10.0.0'
[debug] [ADB] Setting device id to emulator-5554
[ADB] Getting device platform version
[debug] [ADB] Running 'C:\Users\IDN MEDIA\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell getprop ro.build.version.release'
[debug] [ADB] Current device property 'ro.build.version.release': 10
[AndroidDriver] Using device: emulator-5554
[debug] [FlutterDriver] C:\Users\IDN MEDIA\AppData\Local\Android\Sdk\platform-tools\adb.exe -s emulator-5554 forward tcp:35073 tcp:35073
[debug] [FlutterDriver] Error: Command failed: C:\Users\IDN MEDIA\AppData\Local\Android\Sdk\platform-tools\adb.exe -s emulator-5554 forward tcp:35073 tcp:35073
[debug] [FlutterDriver] 'C:\Users\IDN' is not recognized as an internal or external command,
[debug] [FlutterDriver] operable program or batch file.
[debug] [FlutterDriver]
[debug] [FlutterDriver] at ChildProcess.exithandler (node:child_process:419:12)
[debug] [FlutterDriver] at ChildProcess.emit (node:events:514:28)
[debug] [FlutterDriver] at maybeClose (node:internal/child_process:1091:16)
[debug] [FlutterDriver] at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
[FlutterDriver] Connecting to Dart Observatory: undefined
[FlutterDriver] {}
[FlutterDriver] Check Dart Observatory URI no URI found in the device log
[FlutterDriver] Failed to connect 30 times. Aborting.
[debug] [FlutterDriver] Deleting Flutter Driver session
[debug] [AppiumDriver@bae3] Event 'newSessionStarted' logged at 1692632217561 (22:36:57 GMT+0700 (Western Indonesia Time))
[debug] [AppiumDriver@bae3] Encountered internal error running command: Error: Failed to connect 30 times. Aborting.
[debug] [AppiumDriver@bae3] at Object.wrappedLogger.errorAndThrow (C:\Users\IDN MEDIA.appium\node_modules\appium-flutter-driver\node_modules@appium\support\lib\logging.js:115:34)
[debug] [AppiumDriver@bae3] at connectSocket (C:\Users\IDN MEDIA.appium\node_modules\appium-flutter-driver\lib\sessions\observatory.ts:132:11)
[debug] [AppiumDriver@bae3] at processTicksAndRejections (node:internal/process/task_queues:95:5)
[debug] [AppiumDriver@bae3] at async Promise.all (index 1)
[debug] [AppiumDriver@bae3] at FlutterDriver.createSession (C:\Users\IDN MEDIA.appium\node_modules\appium-flutter-driver\lib\sessions\session.ts:43:47)
[debug] [AppiumDriver@bae3] at AppiumDriver.createSession (C:\Users\IDN MEDIA\AppData\Roaming\npm\node_modules\appium\lib\appium.js:374:35)
[HTTP] <-- POST /session 500 96906 ms - 648
[HTTP]

Anyone can help? Thanks

Keyword "Get element Text" not working

Appium v1.22.2
Flutter 2.8.1
Dart 2.15.1
robotframework 4.1.2
robotframework-appiumflutterlibrary 1.0.0b2

The keyword "Get element Text" : _element.py#L89

Is not working, because the command flutter:getText does not exist :

def _get_element_text(self, element):
        application = self._current_application()
        return application.execute_script('flutter:getText', element)

According to Appium Flutter Driver : https://github.com/appium-userland/appium-flutter-driver#commands
Also the command does not exist : https://github.com/appium-userland/appium-flutter-driver/blob/8a08f54b76df3be1c880f6420a4ad7b81e9086b6/driver/lib/commands/execute.ts#L18

Appium logs :

[HTTP] --> POST /wd/hub/session/9c1336c1-7e00-46e4-a62b-91388c2ab639/execute/sync
[HTTP] {"script":"flutter:getText","args":[{"element-6066-11e4-a52e-4f735466cecf":"eyJmaW5kZXJUeXBlIjoiQnlWYWx1ZUtleSIsImtleVZhbHVlU3RyaW5nIjoiY291bnRlck5iIiwia2V5VmFsdWVUeXBlIjoiU3RyaW5nIn0="}]}
[debug] [W3C (9c1336c1)] Calling AppiumDriver.execute() with args: ["flutter:getText",[{"element-6066-11e4-a52e-4f735466cecf":"eyJmaW5kZXJUeXBlIjoiQnlWYWx1ZUtleSIsImtleVZhbHVlU3RyaW5nIjoiY291bnRlck5iIiwia2V5VmFsdWVUeXBlIjoiU3RyaW5nIn0="}],"9c1336c1-7e00-46e4-a62b-91388c2ab639"]
[debug] [FlutterDriver] Executing Flutter driver command 'execute'
[debug] [W3C (9c1336c1)] Encountered internal error running command: Error: Command not support: "flutter:getText"
[debug] [W3C (9c1336c1)]     at FlutterDriver.exports.execute (C:\Users\ggpf9966\AppData\Roaming\nvm\v12.16.1\node_modules\appium\node_modules\appium-flutter-driver\lib\commands\execute.ts:62:13)
[debug] [W3C (9c1336c1)]     at commandExecutor (C:\Users\ggpf9966\AppData\Roaming\nvm\v12.16.1\node_modules\appium\node_modules\appium-base-driver\lib\basedriver\driver.js:335:9)
[debug] [W3C (9c1336c1)]     at C:\Users\ggpf9966\AppData\Roaming\nvm\v12.16.1\node_modules\appium\node_modules\async-lock\lib\index.js:146:12
[debug] [W3C (9c1336c1)]     at AsyncLock._promiseTry (C:\Users\ggpf9966\AppData\Roaming\nvm\v12.16.1\node_modules\appium\node_modules\async-lock\lib\index.js:280:31)
[debug] [W3C (9c1336c1)]     at exec (C:\Users\ggpf9966\AppData\Roaming\nvm\v12.16.1\node_modules\appium\node_modules\async-lock\lib\index.js:145:9)
[debug] [W3C (9c1336c1)]     at AsyncLock.acquire (C:\Users\ggpf9966\AppData\Roaming\nvm\v12.16.1\node_modules\appium\node_modules\async-lock\lib\index.js:162:3)
[debug] [W3C (9c1336c1)]     at FlutterDriver.executeCommand (C:\Users\ggpf9966\AppData\Roaming\nvm\v12.16.1\node_modules\appium\node_modules\appium-base-driver\lib\basedriver\driver.js:348:39)
[debug] [W3C (9c1336c1)]     at FlutterDriver.executeCommand (C:\Users\ggpf9966\AppData\Roaming\nvm\v12.16.1\node_modules\appium\node_modules\appium-flutter-driver\lib\driver.ts:132:22)
[debug] [W3C (9c1336c1)]     at AppiumDriver.executeCommand (C:\Users\ggpf9966\AppData\Roaming\nvm\v12.16.1\node_modules\appium\lib\appium.js:563:36)
[debug] [W3C (9c1336c1)]     at processTicksAndRejections (internal/process/task_queues.js:97:5)
[debug] [W3C (9c1336c1)]     at asyncHandler (C:\Users\ggpf9966\AppData\Roaming\nvm\v12.16.1\node_modules\appium\node_modules\appium-base-driver\lib\protocol\protocol.js:297:21)
[HTTP] <-- POST /wd/hub/session/9c1336c1-7e00-46e4-a62b-91388c2ab639/execute/sync 500 148 ms - 667

All 'flutter:xxx' execute commands are failing if 'element' argument in it

Appium v1.22.2
Flutter 2.8.1
Dart 2.15.1
robotframework 4.1.2
robotframework-appiumflutterlibrary 1.0.0b2

Keywords like :

  1. wait_for_element --> application.execute_script('flutter:waitFor', element)
  2. wait_for_element_absent --> application.execute_script('flutter:waitForAbsent', element)
  3. get_element_text --> application.execute_script('flutter:getText', element) (also see #9)
  4. scroll_to_element --> application.execute_script('flutter:scrollIntoView', element, 0)

Are failing with similar Appium log Error: input is invalid :

[HTTP] --> POST /wd/hub/session/e556a14a-d2af-4996-abfb-dbd3e3ce148c/execute/sync
[HTTP] {"script":"flutter:waitFor","args":[{"element-6066-11e4-a52e-4f735466cecf":"eyJmaW5kZXJUeXBlIjoiQnlWYWx1ZUtleSIsImtleVZhbHVlU3RyaW5nIjoid3JvbmdLZXkiLCJrZXlWYWx1ZVR5cGUiOiJTdHJpbmcifQ=="},20]}
[debug] [W3C (e556a14a)] Calling AppiumDriver.execute() with args: ["flutter:waitFor",[{"element-6066-11e4-a52e-4f735466cecf":"eyJmaW5kZXJUeXBlIjoiQnlWYWx1ZUtleSIsImtleVZhbHVlU3RyaW5nIjoid3JvbmdLZXkiLCJrZXlWYWx1ZVR5cGUiOiJTdHJpbmcifQ=="},20],"e556a14a-d2af-4996-abfb-dbd3e3ce148c"]
[debug] [FlutterDriver] Executing Flutter driver command 'execute'
[debug] [W3C (e556a14a)] Encountered internal error running command: Error: input is invalid {"element-6066-11e4-a52e-4f735466cecf":"eyJmaW5kZXJUeXBlIjoiQnlWYWx1ZUtleSIsImtleVZhbHVlU3RyaW5nIjoid3JvbmdLZXkiLCJrZXlWYWx1ZVR5cGUiOiJTdHJpbmcifQ=="}
[debug] [W3C (e556a14a)]     at Object.exports.decode (C:\Users\ggpf9966\AppData\Roaming\nvm\v12.16.1\node_modules\appium\node_modules\finder\nodejs\lib\base64url.ts:15:11)
[debug] [W3C (e556a14a)]     at Object.exports.deserialize (C:\Users\ggpf9966\AppData\Roaming\nvm\v12.16.1\node_modules\appium\node_modules\finder\nodejs\lib\deserializer.ts:4:14)
[debug] [W3C (e556a14a)]     at FlutterDriver.exports.executeElementCommand (C:\Users\ggpf9966\AppData\Roaming\nvm\v12.16.1\node_modules\appium\node_modules\appium-flutter-driver\lib\sessions\observatory.ts:128:41)
[debug] [W3C (e556a14a)]     at Object.waitFor (C:\Users\ggpf9966\AppData\Roaming\nvm\v12.16.1\node_modules\appium\node_modules\appium-flutter-driver\lib\commands\execute\wait.ts:20:14)
[debug] [W3C (e556a14a)]     at FlutterDriver.exports.execute (C:\Users\ggpf9966\AppData\Roaming\nvm\v12.16.1\node_modules\appium\node_modules\appium-flutter-driver\lib\commands\execute.ts:44:14)
[debug] [W3C (e556a14a)]     at commandExecutor (C:\Users\ggpf9966\AppData\Roaming\nvm\v12.16.1\node_modules\appium\node_modules\appium-base-driver\lib\basedriver\driver.js:335:9)
[debug] [W3C (e556a14a)]     at C:\Users\ggpf9966\AppData\Roaming\nvm\v12.16.1\node_modules\appium\node_modules\async-lock\lib\index.js:146:12
[debug] [W3C (e556a14a)]     at AsyncLock._promiseTry (C:\Users\ggpf9966\AppData\Roaming\nvm\v12.16.1\node_modules\appium\node_modules\async-lock\lib\index.js:280:31)
[debug] [W3C (e556a14a)]     at exec (C:\Users\ggpf9966\AppData\Roaming\nvm\v12.16.1\node_modules\appium\node_modules\async-lock\lib\index.js:145:9)
[debug] [W3C (e556a14a)]     at AsyncLock.acquire (C:\Users\ggpf9966\AppData\Roaming\nvm\v12.16.1\node_modules\appium\node_modules\async-lock\lib\index.js:162:3)
[debug] [W3C (e556a14a)]     at FlutterDriver.executeCommand (C:\Users\ggpf9966\AppData\Roaming\nvm\v12.16.1\node_modules\appium\node_modules\appium-base-driver\lib\basedriver\driver.js:348:39)
[debug] [W3C (e556a14a)]     at FlutterDriver.executeCommand (C:\Users\ggpf9966\AppData\Roaming\nvm\v12.16.1\node_modules\appium\node_modules\appium-flutter-driver\lib\driver.ts:132:22)
[debug] [W3C (e556a14a)]     at AppiumDriver.executeCommand (C:\Users\ggpf9966\AppData\Roaming\nvm\v12.16.1\node_modules\appium\lib\appium.js:563:36)
[debug] [W3C (e556a14a)]     at runMicrotasks (<anonymous>)
[debug] [W3C (e556a14a)]     at processTicksAndRejections (internal/process/task_queues.js:97:5)
[debug] [W3C (e556a14a)]     at asyncHandler (C:\Users\ggpf9966\AppData\Roaming\nvm\v12.16.1\node_modules\appium\node_modules\appium-base-driver\lib\protocol\protocol.js:297:21)
[HTTP] <-- POST /wd/hub/session/e556a14a-d2af-4996-abfb-dbd3e3ce148c/execute/sync 500 28 ms - 929

I think the root cause is because :

  1. commands like "click" need a FlutterElement (https://github.com/appium-userland/appium-flutter-driver/blob/329a05120c016b32c58a2dc88747873df5248b46/example/python/example.py#L29) like {"element-6066-11e4-a52e-4f735466cecf":"eyJmaW5kZXJUeXBlIjoiQnlWYWx1ZUtleSIsImtleVZhbHVlU3RyaW5nIjoid3JvbmdLZXkiLCJrZXlWYWx1ZVR5cGUiOiJTdHJpbmcifQ=="}
  2. but commands like "flutter:" only need the base64 value returned by finder.by_xxx (https://github.com/appium-userland/appium-flutter-driver/blob/329a05120c016b32c58a2dc88747873df5248b46/example/python/example.py#L32)

We can solve this (I tested it) by adding element.id instead of element everywhere there is a "flutter:" execute command
Like this : application.execute_script('flutter:waitFor', element.id)
The id is an internal base64 ID used by selenium (selenium\webdriver\remote\webelement.py)
Example id : eyJmaW5kZXJUeXBlIjoiQnlWYWx1ZUtleSIsImtleVZhbHVlU3RyaW5nIjoid3JvbmdLZXkiLCJrZXlWYWx1ZVR5cGUiOiJTdHJpbmcifQ==

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.