The 'flutter:waitFor' command doesn't work with '{durationMilliseconds: 100}' option
See original GitHub issueFirst case
Using the flutter:waitFor
command with {durationMilliseconds: 100}
as specified in the appium-flutter-driver Commands returns an error:
An unknown server-side error occurred while processing the command. Original error: durationMilliseconds is not a valid options.
Command example:
await driver.execute('flutter:waitFor', find.byValueKey('password'), {durationMilliseconds: 100});
Second case
If use the flutter:waitFor
command with milliseconds
as mentioned in one of the ‘Issues’ here, for example:
await driver.execute('flutter:waitFor', find.byValueKey('password'), 5000);
It works, the command waits for 5 seconds (with 3 tries, 15 seconds in total), BUT in case the element is not displayed within the specified time - it also returns an server-side error:
An unknown server-side error occurred while processing the command. Original error: Cannot execute command waitFor, server reponse {
"isError": true,
"response": "Timeout while executing waitFor: TimeoutException after 0:00:05.000000: Future not completed\n",
"type": "_extensionType",
"method": "ext.flutter.driver"
}
I’m using WebdriverIO + appium 2.0.0-beta.44 + appium-flutter-driver 1.7.2 + appium-flutter-finder 0.1.0
So what is the correct way to use the flutter:waitFor
command? Maybe there is some other alternative?
Issue Analytics
- State:
- Created a year ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
"Error: durationMilliseconds is not a valid options" - flutter ...
ie: The timeout is for 1000 milliseconds (not 1 millisecond). The wait.ts logic does *1000 on the durationMilliseconds parameter; so the ...
Read more >How can I "sleep" a Dart program - Stack Overflow
import 'dart:io'; sleep(Duration(seconds:1));. Note: This blocks the entire process (isolate), so other async functions will not be processed.
Read more >WaitUntil flutter Code Example - Code Grepper
1. Future.delayed(Duration(milliseconds: 100), () { ; 2. // Do something ; 3. }); ; 4. .
Read more >Re: How to blocking async future execution until future don't ...
Basically Process.run() is a one shot, run a command and wait for the results. ... Like JavaScript, the language's execution model simply doesn't...
Read more >How to run code when your app is terminated
If you need to execute code when your app isn't running, there are several options open to you depending on what you're trying...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The error and the behavior itself come from Flutter/Dart VM. Appium flutter driver just sends commands defined in https://api.flutter.dev/flutter/flutter_driver/flutter_driver-library.html to them. Thus, if something behavior seems weird, maybe you need to report it in the Flutter team. (but I guess they won’t maintain the flutter_driver so much.)
Thank you. I’ve modified the readme