DEV Community

Flutter app automate testing with Appium Flutter Driver

Taweechai Maklay on November 02, 2019

As tech person whom adopted flutter in tech portfolio (got much friction around this). The most question I've got is testing automation engineer di...
Collapse
 
atul161 profile image
atul anand

Is there any ways to automate google Authorization using appium ?
How can i test webview using this. library .
Thanks in Advance\

Collapse
 
joyce0101 profile image
joyce0101

I also encountered this problem. I want to test a hybrid application of flutter and webview. Have you found a good solution?

Collapse
 
veenaharsha profile image
Veena Yemmiganur

Hello Taweechai,
How are you.
Thanks for the blog.
Am trying to set up the test automation for flutter application using Appium,
am new to Appium & flutter, am looking at setting up the testing project , preferably in javascript.
Thanks in advance

Collapse
 
iabhay85 profile image
iabhay85

(node:74846) UnhandledPromiseRejectionWarning: Error: An unknown server-side error occurred while processing the command. Original error: Cannot execute command waitFor, server reponse {
"isError": true,
"response": "Uncaught extension error while executing waitFor: 'package:flutter_driver/src/extension/extension.dart': Failed assertion: line 373 pos 14: 'WidgetsBinding.instance!.isRootWidgetAttached || !command.requiresRootWidgetAttached': No root widget is attached; have you remembered to call runApp()?\n#0 _AssertionError._doThrowNew (dart:core-patch/errors_patch.dart:46:39)\n#1 _AssertionError._throwNew (dart:core-patch/errors_patch.dart:36:5)\n#2 FlutterDriverExtension.call (package:flutter_driver/src/extension/extension.dart:373:14)\n#3 BindingBase.registerServiceExtension. (package:flutter/src/foundation/binding.dart:597:32)\n\n",
"type": "_extensionType",
"method": "ext.flutter.driver"
}

Collapse
 
iabhay85 profile image
iabhay85

Getting below error can some one help here

Collapse
 
fredrickpard profile image
Kodomo

Hey Taweechai, thanks for your tutorial. But, it still a bit difficult for me as a new user to understand the procedure for it.
Can you please create a demo video?
Thank you

Collapse
 
nitinvermaa profile image
Nitinvermaa

Hi Taweechai,
Hope you are doing good.

I'm getting the below issue while running nodejs project.
Node Version: 12.13.1
appium: 1.18.1

2020-09-02T19:43:13.369Z ERROR webdriver: Request failed due to Error: read ECONNRESET
at TCP.onStreamRead (internal/stream_base_commons.js:201:27)
(node:29568) UnhandledPromiseRejectionWarning: Error: read ECONNRESET
at TCP.onStreamRead (internal/stream_base_commons.js:201:27)
(node:29568) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by
rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:29568) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js pro
cess with a non-zero exit code.

Collapse
 
veenaharsha profile image
Veena Yemmiganur

Hi ,
Am also facing the same issue..
Did u get the solution for this issue

Collapse
 
zaphodikus profile image
Conrad Braam🤖

Can you explain this statement, but in a way a test engineer who does NOT write DART/Flutter code can go check and understand this? My team uses a framework that generates a lot of code, so the explanation assumes a but much of me. Giving controls a key or ID changes the kind of control or is the key "metadata" that the special driver hooks into?
"Since Flutter did not use native conponents, it's mean you need to define keys in all of your widget to made your widgets visible to appium-flutter-driver (also for normal flutter testing)."

Collapse
 
giangthao profile image
giangthao

I can't catch id, accessibility id, xpath after switch to NATIVE even though runInbackground worked my code await driver.switchContext('NATIVE_APP');
await driver.saveScreenshot('./native-screenshot.png');
driver.background(10)
// await driver.back();
await driver.pause(3000)
await (await await driver.$('//android.widget.ImageView[@content-desc="Project\n Tab 2 of 4"]')).click();

Collapse
 
hattersharath profile image
hattersharath

Hi Taweechai,

It was a great explanation. As I am a beginner, I wanted to check can we implement this using java?

Thank you
Sharath

Collapse
 
tempest1000 profile image
Tempest1000

Take a look at the following:

github.com/truongsinh/appium-flutt...

And this article which describes how to use Appium Flutter Finder and Java (use Google Translate browser plugin to convert the language):
cnblogs.com/hbolin/p/12510967.html

Collapse
 
netfirms profile image
Taweechai Maklay

I've found JavaScript only for now.

Collapse
 
dpk7974 profile image
dpk7974

Hey Taweechai, still I am confused how to set up the flutter driver over eclipse, can you please create a demo video of Flutter app automation?

Collapse
 
netfirms profile image
Taweechai Maklay

I think you don't need any IDE to do testing setup.

Collapse
 
tevaautomation profile image
Automation

Hey Taweechai, thanks for your tutorial. i couldn't understand if Appium fluuter driver works on real IOS device , not just on emulator or simulator.
is it possible?