Cannot read properties of undefined (reading 'match') appium flutter driver

260 Views Asked by At
\[debug] [FlutterDriver] Deleting Flutter Driver session[debug] [BaseDriver] Event 'newSessionStarted' logged at 1672668476064 (19:07:56 GMT+0500 (Pakistan Standard Time))[debug] [W3C] Encountered internal error running command: TypeError: Cannot read properties of undefined (reading 'match')[debug] [W3C]     at Object.exports.processLogToGetobservatory (C:\Users\asad.sidhu\AppData\Roaming\npm\node_modules\appium\node_modules\appium-flutter-driver\build\driver\lib\sessions\observatory.js:118:9)[debug] [W3C]     at Object.exports.getObservatoryWsUri (C:\Users\asad.sidhu\AppData\Roaming\npm\node_modules\appium\node_modules\appium-flutter-driver\lib\sessions\android.ts:39:21)[debug] [W3C]     at Object.exports.startAndroidSession (C:\Users\asad.sidhu\AppData\Roaming\npm\node_modules\appium\node_modules\appium-flutter-driver\lib\sessions\android.ts:26:30)[debug] [W3C]     at processTicksAndRejections (node:internal/process/task_queues:95:5)[debug] [W3C]     at FlutterDriver.exports.createSession (C:\Users\asad.sidhu\AppData\Roaming\npm\node_modules\appium\node_modules\appium-flutter-driver\lib\sessions\session.ts:21:47)[debug] [W3C]     at AppiumDriver.createSession (C:\Users\asad.sidhu\AppData\Roaming\npm\node_modules\appium\lib\appium.js:387:35)[HTTP] <-- POST /wd/hub/session 500 16629 ms - 677[HTTP][debug] [Instrumentation] The process has exited with code 0

When I try to run my java automation code with appium flutter driver, it gives me this error. \*\*Cannot read properties of undefined (reading 'match') appium flutter driver \*\* Please help, I have been stuck with this problem for a couple of days!!! Here are the appium logs:

I expected the tests to open the app, find the elements by valuekeys and interact with them, but the app installs, opens and crashes on start up.`

1

There are 1 best solutions below

0
On

You will need to create an instrumented build that exposes the websocket url, i.e "ObservatoryWsUri" in this case. Without exposing this ws url you may not be able to communicate with dart VM layer, in other words flutter automation is not possible.

In order to expose this URL may can try to talk to your flutter developer to include below line of code in entrypoint(main.dart) file and provide instrumented build to you.

enableFlutterDriverExtension(
  commands: [],
  finders: []
);