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

\[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.`

Related

Can I do Appium inspector connected simulator without error code 65

I had started a session between appium server and simulator(at xcode).
But xcodebuild failed with code 65
xcodebuild error message:
[debug] [W3C]
[debug] [W3C] at quitAndUninstall (/usr/local/Cellar/appium/1.22.3/libexec/lib/node_modules/appium/node_modules/appium-xcuitest-driver/lib/driver.js:588:15)
[debug] [W3C] at /usr/local/Cellar/appium/1.22.3/libexec/lib/node_modules/appium/node_modules/appium-xcuitest-driver/lib/driver.js:623:11
[debug] [W3C] at wrapped (/usr/local/Cellar/appium/1.22.3/libexec/lib/node_modules/appium/node_modules/asyncbox/lib/asyncbox.js:60:13)
[debug] [W3C] at retry (/usr/local/Cellar/appium/1.22.3/libexec/lib/node_modules/appium/node_modules/asyncbox/lib/asyncbox.js:43:13)
[debug] [W3C] at retryInterval (/usr/local/Cellar/appium/1.22.3/libexec/lib/node_modules/appium/node_modules/asyncbox/lib/asyncbox.js:70:10)
[debug] [W3C] at /usr/local/Cellar/appium/1.22.3/libexec/lib/node_modules/appium/node_modules/appium-xcuitest-driver/lib/driver.js:603:7
[debug] [iOSSim] The simulator has '0' bundles which have 'WebDriverAgentRunner-Runner' as their 'CFBundleName':
[debug] [WebDriverAgent] No WDAs on the device.
I have kwnown that appium inspector connected with simulator does not need webAgentDriver. It isn't true?
In concolusion,
A simulator must need a WebDriverAgent? not for only a real device?
What is webDriverAgent? I think that it only let appium control iOS devices.
If using xcode 14 we need to have appium 2 and appium inspector installed to be able to access the app
Make sure you have node 16.16, if you don’t you can install nvm and use it to install multiple versions of node on the machine, you can fine NVM here
Install Appium 2 using: npm install -g appium#next
Once Appium is installed run appium -v to confirm that you have version > 2
Install XCUITest driver: appium driver install xcuitest
Install UIAutomator2: appium driver install uiautomator
Run appium driver list to confirm that both drivers are installed
Install Appium Inspector: can be downloaded here, download the latest version.

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

When trying to run app on robotframework-flutter-driver, getting TypeError:Cannot read properties of undefined (reading 'match')
[debug] [FlutterDriver] Deleting Flutter Driver session
[debug] [BaseDriver] Event 'newSessionStarted' logged at 1660058960935 (20:59:20 GMT+0530 (India 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\sfwwi\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\sfwwi\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\sfwwi\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:96:5)
[debug] [W3C] at FlutterDriver.exports.createSession (C:\Users\sfwwi\AppData\Roaming\npm\node_modules\appium\node_modules\appium-flutter-driver\lib\sessions\session.ts:21:47)
[debug] [W3C] at AppiumDriver.createSession (C:\Users\sfwwi\AppData\Roaming\npm\node_modules\appium\lib\appium.js:387:35)
[HTTP] <-- POST /wd/hub/session 500 48304 ms - 667
Getting 500 and the app got shutdown. Please do help on this anyone?

Error occured while starting App. Original error: com.abc.xyz.ui.SplashActivity or com.abc.xyz.dev.com.abc.xyz.ui.SplashActivity never started

I recently started facing this issue.
I upgraded my appium version to 1.6.5 but while running automation when i try to launch app i am getting following error.
[ADB] Error: com.abc.xyz.ui.SplashActivity or com.abc.xyz.dev.com.abc.xyz.ui.SplashActivity never started
at Object.wrappedLogger.errorAndThrow (../../lib/logging.js:63:13)
at ADB.callee$0$0$ (../../../lib/tools/apk-utils.js:153:7)
at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
at <anonymous>
Appium couldn't automatically match the activity when your android app been launched.
This can be solved by providing activity and package name you want appium to wait for in capabilities:
E.g
"appWaitActivity" : "com.abc.xyz.ui.SomeActivity",
"appWaitPackage" : "com.abc.xyz"
You can use adb shell dumpsys activity to get current activity of your app

Appium path issue

I'm trying to run an apk file from my test suite in appium, the emulator runs successfully but at the time of launch of the apk it says apk not found. The path looks correct to me still unable to figure out the solution.
Below is the error from Appium.
AndroidDriver] Using device: emulator-5554
[ADB] Checking whether adb is present
[ADB] Using adb from /Library/Android/sdk/platform-tools/adb
[debug] [ADB] Setting device id to emulator-5554
[BaseDriver] Using local app '/src/test/resources/myapp.apk'
[debug] [AndroidDriver] Checking whether app is actually present
[debug] [AndroidDriver] Shutting down Android driver
[AndroidDriver] Cannot shut down Android driver; it has already shut down
[HTTP] <-- POST /wd/hub/session 500 25028 ms - 212
[AndroidDriver] Error: Could not find app apk at /src/test/resources/myapp.apk
at Object.wrappedLogger.errorAndThrow (lib/logger.js:60:13)
at AndroidDriver.checkAppPresent$ (lib/driver.js:274:11)
at tryCatch (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at GeneratorFunctionPrototype.invoke (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
at run (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/node_modules/core-js/library/modules/es6.promise.js:104:47)
at /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/node_modules/core-js/library/modules/es6.promise.js:115:28
at flush (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/node_modules/core-js/library/modules/$.microtask.js:19:5)
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickCallback (internal/process/next_tick.js:98:9)
[Error: Could not find app apk at /src/test/resources/myapp.apk]
I tried following path apart from the one listed above:
1. ./src/test
2. Start from the module name which is part of /src/test i.e. modulename/src/test
3. Tried ~./src/test
4. Tried ~/src/test
Any pointers as to what is it that I'm missing?
Also, why am I getting this ([debug] [AndroidDriver] Shutting down Android driver) before the apk launch?
Code:
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(MobileCapabilityType.FULL_RESET,"true");
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME,"Nexus10");
capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION,"4.4");
capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME,"Android");
capabilities.setCapability(MobileCapabilityType.APP,"myapp.package");
capabilities.setCapability(MobileCapabilityType.NEW_COMMAND_TIMEOUT, "20");
capabilities.setCapability("app", "/src/test/resources/myapp.apk");
AndroidDriver = new AndroidDriver(new URL("http://127.0.0.1:4724/wd/hub"), capabilities);
AndroidDriver.rotate(ScreenOrientation.PORTRAIT);
log.info("Set up done for capabilities");
Thanks in advance.
If the 'src' folder is in the same location as you're running from, you want to remove the preceding '/' as that's telling Appium to look starting at the root of the entire file system rather than from your local path.
src/test/resources/myapp.apk
My experience is that using '~' does not work with Appium. I personally have parameterized the app location and pull it from an environment variable to account for it being in different places on different systems, but in all cases I provide the path from the file system root as it's simplest.

Not able to launch iOS application using Appium Desktop to inspect the element

Test Environment: iOS 11, OSX 10.12, Appium Desktop 1.2.5, Xcode 8.1
Desired Capabilities :
{
"platformName": "iOS",
"deviceName": "iPhone 7",
"udid": "93551a7d721b790b0188642402f1ada96892b816",
"app": "/Users/globalit/Desktop/IntegrationApp.app",
"automationName": "XCUITest"
}
I am able to launch integration app in the device using xcode.
also successfully deployed web-driver agent in my device.
But i am getting following error when i tried to launch my ios application via appium desktop.
Error:
An unknown server-side error occurred while processing the command. Original error: Unable to start WebDriverAgent session because of xcodebuild failure: "Could not proxy command to remote server. Original error: Error: socket hang up". Make sure you follow the tutorial at https://github.com/appium/appium-xcuitest-driver/blob/master/docs/real-device-config.md. Try to remove the WebDriverAgentRunner application from the device if it is installed and reboot the device.
Appium Logs:
XCUITest] Failed to create WDA session. Retrying...
[BaseDriver] Event 'wdaSessionAttempted' logged at 1509096179356 (14:52:59 GMT+0530 (IST))
[XCUITest] Sending createSession command to WDA
[JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[XCUITest] Failed to create WDA session. Retrying...
[XCUITest] Unable to start WebDriverAgent session because of xcodebuild failure: "Could not proxy command to remote server. Original error: Error: socket hang up". Make sure you follow the tutorial at https://github.com/appium/appium-xcuitest-driver/blob/master/docs/real-device-config.md. Try to remove the WebDriverAgentRunner application from the device if it is installed and reboot the device.
[XCUITest] Quitting and uninstalling WebDriverAgent, then retrying
[XCUITest] Shutting down sub-processes
[XCUITest] Shutting down iproxy process (pid 576)
[XCUITest] iproxy exited with code 'null'
[XCUITest] Shutting down xcodebuild process (pid 577)
[XCUITest] xcodebuild exited with code 'null' and signal 'SIGTERM'
[XCUITest] Removing WDA application from device
[XCUITest] Error: Unable to start WebDriverAgent session because of xcodebuild failure: "Could not proxy command to remote server. Original error: Error: socket hang up". Make sure you follow the tutorial at https://github.com/appium/appium-xcuitest-driver/blob/master/docs/real-device-config.md. Try to remove the WebDriverAgentRunner application from the device if it is installed and reboot the device.
at XCUITestDriver.quitAndUninstall$ (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/lib/driver.js:381:13)
at tryCatch (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at GeneratorFunctionPrototype.invoke (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
Error: Unable to start WebDriverAgent session because of xcodebuild failure: "Could not proxy command to remote server. Original error: Error: socket hang up". Make sure you follow the tutorial at https://github.com/appium/appium-xcuitest-driver/blob/master/docs/real-device-config.md. Try to remove the WebDriverAgentRunner application from the device if it is installed and reboot the device.
at XCUITestDriver.quitAndUninstall$ (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/lib/driver.js:381:13)
at tryCatch (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at GeneratorFunctionPrototype.invoke (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
[XCUITest] Not clearing log files. Use `clearSystemFiles` capability to turn on.
[iOSLog] Stopping iOS log capture
[MJSONWP] Encountered internal error running command: Error: Unable to start WebDriverAgent session because of xcodebuild failure: "Could not proxy command to remote server. Original error: Error: socket hang up". Make sure you follow the tutorial at https://github.com/appium/appium-xcuitest-driver/blob/master/docs/real-device-config.md. Try to remove the WebDriverAgentRunner application from the device if it is installed and reboot the device.
at XCUITestDriver.quitAndUninstall$ (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/lib/driver.js:381:13)
at tryCatch (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at GeneratorFunctionPrototype.invoke (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
[HTTP] <-- POST /wd/hub/session 500 118446 ms - 526

Resources