appium / appium-flutter-driver

Appium Flutter Driver is a test automation tool for Flutter apps on multiple platforms/OSes. Appium Flutter Driver is part of the Appium mobile test automation tool maintained by community
MIT License
461 stars 184 forks source link

Getting error when "automationName" is set as "Flutter" #344

Closed Bouqui closed 2 years ago

Bouqui commented 2 years ago

Hi, I am pretty new to appium-flutter-driver. I am currently trying to do a set up for it but I am getting an error every time I set "automationName" as "Flutter"

Error - An unknown server-side error occurred while processing the command. Original error: Cannot read property 'match' of undefined

Below are the dependencies I added to my pom.xml

io.appium java-client 7.6.0
    <dependency>
        <groupId>org.projectlombok</groupId>
        <artifactId>lombok</artifactId>
        <version>1.18.24</version>
    </dependency>
    <dependency>
        <groupId>org.testng</groupId>
        <artifactId>testng</artifactId>
        <version>7.1.0</version>
        <scope>test</scope>
    </dependency>

    <dependency>
        <groupId>com.squareup.okhttp3</groupId>
        <artifactId>okhttp</artifactId>
        <version>4.9.3</version>
    </dependency>
    <dependency>
        <groupId>pro.truongsinh</groupId>
        <artifactId>appium-flutter-finder</artifactId>
        <version>0.0.4</version>
    </dependency>
    <dependency>
        <groupId>org.jetbrains.kotlinx</groupId>
        <artifactId>kotlinx-serialization-runtime</artifactId>
        <version>0.14.0</version>
        <scope>runtime</scope>
    </dependency>

Language - Java

Pls, help as I am currently stuck

Thanks

KazuCocoa commented 2 years ago

Could you try out the latest version with appium 2 and share the full appium log?

npm install -g appium@next

Then https://github.com/appium-userland/appium-flutter-driver#installation

Bouqui commented 2 years ago

@KazuCocoa I have installed the appium-flutter-driver using the installation guide but I am still getting the error.

I have appium 1.22.2 installed and below is the full appium log

[info] [Appium] Welcome to Appium v1.22.2
[info] [Appium] Non-default server args:
[info] [Appium]   relaxedSecurityEnabled: true
[info] [Appium]   allowInsecure: {
[info] [Appium]   }
[info] [Appium]   denyInsecure: {
[info] [Appium]   }
[info] [Appium] Appium REST http interface listener started on 0.0.0.0:4723[info] [HTTP] --> POST /wd/hub/session
[info] [HTTP] {"desiredCapabilities":{"app":"
/repos/rq_mobile-automation/apps/Runner.app","noReset":"true","platformVersion":"16.0","automationName":"Flutter","skipUnlock":"true","platformName":"ios","udid":"15FC87B5-38ED-4C88-BF90-68C916FE2C6B","deviceName":"iPhone 13 Pro"},"capabilities":{"firstMatch":[{"appium:app":"
repos/rq_mobile-automation/apps/Runner.app","appium:automationName":"Flutter","appium:deviceName":"iPhone 13 Pro","appium:noReset":"true","platformName":"ios","appium:platformVersion":"16.0","skipUnlock":"true","appium:udid":"15FC87B5-38ED-4C88-BF90-68C916FE2C6B"}]}}
[debug] [W3C] Calling AppiumDriver.createSession() with args: [{"app":"/repos/rq_mobile-automation/apps/Runner.app","noReset":"true","platformVersion":"16.0","automationName":"Flutter","skipUnlock":"true","platformName":"ios","udid":"15FC87B5-38ED-4C88-BF90-68C916FE2C6B","deviceName":"iPhone 13 Pro"},null,{"firstMatch":[{"appium:app":"/repos/rq_mobile-automation/apps/Runner.app","appium:automationName":"Flutter","appium:deviceName":"iPhone 13 Pro","appium:noReset":"true","platformName":"ios","appium:platformVersion":"16.0","skipUnlock":"true","appium:udid":"15FC87B5-38ED-4C88-BF90-68C916FE2C6B"}]}]
[debug] [BaseDriver] Event 'newSessionRequested' logged at 1665146016179 (13:33:36 GMT+0100 (Irish Standard Time))
[warn] [BaseDriver] The following capabilities are not standard capabilities and should have an extension prefix:
[warn] [BaseDriver]   skipUnlock
[info] [Appium] Appium v1.22.2 creating new FlutterDriver (v0.0.32) session
[info] [Appium] Applying relaxed security to 'FlutterDriver' as per server command line argument. All insecure features will be enabled unless explicitly disabled by --deny-insecure
[debug] [BaseDriver] W3C capabilities and MJSONWP desired capabilities were provided
[debug] [BaseDriver] Creating session with W3C capabilities: {
[debug] [BaseDriver]   "alwaysMatch": {
[debug] [BaseDriver]     "platformName": "ios",
[debug] [BaseDriver]     "appium:skipUnlock": "true",
[debug] [BaseDriver]     "appium:app": "/repos/rq_mobile-automation/apps/Runner.app",
[debug] [BaseDriver]     "appium:automationName": "Flutter",
[debug] [BaseDriver]     "appium:deviceName": "iPhone 13 Pro",
[debug] [BaseDriver]     "appium:noReset": "true",
[debug] [BaseDriver]     "appium:platformVersion": "16.0",
[debug] [BaseDriver]     "appium:udid": "15FC87B5-38ED-4C88-BF90-68C916FE2C6B"
[debug] [BaseDriver]   },
[debug] [BaseDriver]   "firstMatch": [
[debug] [BaseDriver]     {}
[debug] [BaseDriver]   ]
[debug] [BaseDriver] }
[warn] [BaseDriver] Capability 'noReset' changed from string to boolean. This may cause unexpected behavior
[warn] [BaseDriver] The following capabilities were provided, but are not recognized by Appium:
[warn] [BaseDriver]   skipUnlock
[warn] [BaseDriver]   app
[info] [BaseDriver] Session created with session id: 1ddf2290-aa64-466d-983c-31a1cdbd23c7
[info] [FlutterDriver] Starting an IOS proxy session
[debug] [BaseDriver] W3C capabilities and MJSONWP desired capabilities were provided
[debug] [BaseDriver] Creating session with W3C capabilities: {
[debug] [BaseDriver]   "alwaysMatch": {
[debug] [BaseDriver]     "platformName": "ios",
[debug] [BaseDriver]     "appium:skipUnlock": "true",
[debug] [BaseDriver]     "appium:app": "/repos/rq_mobile-automation/apps/Runner.app",
[debug] [BaseDriver]     "appium:automationName": "Flutter",
[debug] [BaseDriver]     "appium:deviceName": "iPhone 13 Pro",
[debug] [BaseDriver]     "appium:noReset": "true",
[debug] [BaseDriver]     "appium:platformVersion": "16.0",
[debug] [BaseDriver]     "appium:udid": "15FC87B5-38ED-4C88-BF90-68C916FE2C6B"
[debug] [BaseDriver]   },
[debug] [BaseDriver]   "firstMatch": [
[debug] [BaseDriver]     {}
[debug] [BaseDriver]   ]
[debug] [BaseDriver] }
[warn] [BaseDriver] Capability 'noReset' changed from string to boolean. This may cause unexpected behavior
[warn] [BaseDriver] The following capabilities were provided, but are not recognized by Appium:
[warn] [BaseDriver]   skipUnlock
[info] [BaseDriver] Session created with session id: b0cdd4be-1ae5-4056-956b-b4588813155b[debug] [XCUITest] Current user: 
[debug] [XCUITest] Available devices: 
[debug] [XCUITest] No real device with udid '15FC87B5-38ED-4C88-BF90-68C916FE2C6B'. Looking for simulator
[info] [iOSSim] Constructing iOS simulator for Xcode version 14.0.1 with udid '15FC87B5-38ED-4C88-BF90-68C916FE2C6B'
[info] [XCUITest] Determining device to run tests on: udid: '15FC87B5-38ED-4C88-BF90-68C916FE2C6B', real device: false
[debug] [BaseDriver] Event 'xcodeDetailsRetrieved' logged at 1665146017090 (13:33:37 GMT+0100 (Irish Standard Time))
[info] [BaseDriver] Using local app '/repos/rq_mobile-automation/apps/Runner.app'
[debug] [BaseDriver] Event 'appConfigured' logged at 1665146017092 (13:33:37 GMT+0100 (Irish Standard Time))
[debug] [XCUITest] Checking whether app '/repos/rq_mobile-automation/apps/Runner.app' is actually present on file system
[debug] [XCUITest] App is present
[debug] [XCUITest] Getting bundle ID from app '/repos/rq_mobile-automation/apps/Runner.app': 'com.reliaquest.rqfirst'
[debug] [BaseDriver] Event 'resetStarted' logged at 1665146017095 (13:33:37 GMT+0100 (Irish Standard Time))
[debug] [XCUITest] Reset: noReset is on. Leaving simulator as is
[debug] [BaseDriver] Event 'resetComplete' logged at 1665146017095 (13:33:37 GMT+0100 (Irish Standard Time))
[info] [WebDriverAgent] Using WDA path: '/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-webdriveragent'
[info] [WebDriverAgent] Using WDA agent: '/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj'[debug] [IOSSimulatorLog] Starting log capture for iOS Simulator with udid '15FC87B5-38ED-4C88-BF90-68C916FE2C6B' using simctl[debug] [BaseDriver] Event 'logCaptureStarted' logged at 1665146017690 (13:33:37 GMT+0100 (Irish Standard Time))
[info] [XCUITest] Setting up simulator
[debug] [XCUITest] No reason to set locale
[debug] [XCUITest] No iOS / app preferences to set
[debug] [XCUITest] Setting did not need to be updated
[debug] [iOSSim] Setting preferences of 15FC87B5-38ED-4C88-BF90-68C916FE2C6B Simulator to {"ConnectHardwareKeyboard":false}
[debug] [iOSSim] Setting common Simulator preferences to {"RotateWindowWhenSignaledByGuest":true,"ConnectHardwareKeyboard":false,"PasteboardAutomaticSync":false}
[debug] [iOSSim] Updated 15FC87B5-38ED-4C88-BF90-68C916FE2C6B Simulator preferences at '/Library/Preferences/com.apple.iphonesimulator.plist' with {"RotateWindowWhenSignaledByGuest":true,"ConnectHardwareKeyboard":false,"PasteboardAutomaticSync":false,"DevicePreferences":{"15FC87B5-38ED-4C88-BF90-68C916FE2C6B":{"ConnectHardwareKeyboard":false,"SimulatorExternalDisplay":2114,"ChromeTint":"","SimulatorWindowOrientation":"Portrait","SimulatorWindowGeometry":{"EDDF8291-776B-4149-A3E9-43011DEF0508":{"WindowCenter":"{1237, 526}","WindowScale":1}},"SimulatorWindowRotationAngle":0}}}[debug] [iOSSim] Got Simulator UI client PID: 688
[info] [iOSSim] Both Simulator with UDID '15FC87B5-38ED-4C88-BF90-68C916FE2C6B' and the UI client are currently running[debug] [BaseDriver] Event 'simStarted' logged at 1665146018448 (13:33:38 GMT+0100 (Irish Standard Time))
[debug] [XCUITest] Verifying application platform
[debug] [XCUITest] CFBundleSupportedPlatforms: ["iPhoneSimulator"][debug] [XCUITest] App 'com.reliaquest.rqfirst' is already installed. No need to reinstall.
[debug] [BaseDriver] Event 'appInstalled' logged at 1665146018759 (13:33:38 GMT+0100 (Irish Standard Time))
[debug] [WebDriverAgent] No obsolete cached processes from previous WDA sessions listening on port 8100 have been found
[info] [DevCon Factory] Requesting connection for device 15FC87B5-38ED-4C88-BF90-68C916FE2C6B on local port 8100
[debug] [DevCon Factory] Cached connections count: 0
[info] [DevCon Factory] Successfully requested the connection for 15FC87B5-38ED-4C88-BF90-68C916FE2C6B:8100
[debug] [XCUITest] Starting WebDriverAgent initialization with the synchronization key 'XCUITestDriver'
[debug] [WD Proxy] Matched '/status' to command name 'getStatus'
[debug] [WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[debug] [WD Proxy] Got response with status 200: {"value":{"message":"WebDriverAgent is ready to accept commands","state":"success","os":{"testmanagerdVersion":28,"name":"iOS","sdkVersion":"15.4","version":"16.0"},"ios":{"simulatorVersion":"16.0","ip":"10.6.20.39"},"ready":true,"build":{"upgradedAt":"1644399105000","time":"Sep 12 2022 15:30:35","productBundleIdentifier":"com.facebook.WebDriverAgentRunner"}},"sessionId":null}
[debug] [WebDriverAgent] Upgrade timestamp of the currently bundled WDA: 1644399105000
[debug] [WebDriverAgent] Upgrade timestamp of the WDA on the device: 1644399105000
[info] [WebDriverAgent] Will reuse previously cached WDA instance at 'http://127.0.0.1:8100/' with 'com.facebook.WebDriverAgentRunner'. Set the wdaLocalPort capability to a value different from 8100 if this is an undesired behavior.
[debug] [XCUITest] Trying to start WebDriverAgent 2 times with 10000ms interval
[debug] [XCUITest] These values can be customized by changing wdaStartupRetries/wdaStartupRetryInterval capabilities
[debug] [BaseDriver] Event 'wdaStartAttempted' logged at 1665146018864 (13:33:38 GMT+0100 (Irish Standard Time))
[info] [WebDriverAgent] Using provided WebdriverAgent at 'http://127.0.0.1:8100/'
[debug] [WD Proxy] Matched '/status' to command name 'getStatus'
[debug] [WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[debug] [WD Proxy] Got response with status 200: {"value":{"message":"WebDriverAgent is ready to accept commands","state":"success","os":{"testmanagerdVersion":28,"name":"iOS","sdkVersion":"15.4","version":"16.0"},"ios":{"simulatorVersion":"16.0","ip":"10.6.20.39"},"ready":true,"build":{"upgradedAt":"1644399105000","time":"Sep 12 2022 15:30:35","productBundleIdentifier":"com.facebook.WebDriverAgentRunner"}},"sessionId":null}
[debug] [BaseDriver] Event 'wdaSessionAttempted' logged at 1665146018868 (13:33:38 GMT+0100 (Irish Standard Time))
[debug] [XCUITest] Sending createSession command to WDA
[debug] [WD Proxy] Matched '/session' to command name 'createSession'
[debug] [WD Proxy] Proxying [POST /session] to [POST http://127.0.0.1:8100/session] with body: {"capabilities":{"firstMatch":[{"bundleId":"com.reliaquest.rqfirst","arguments":[],"environment":{},"eventloopIdleDelaySec":0,"shouldWaitForQuiescence":true,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true,"shouldTerminateApp":false,"forceAppLaunch":false,"useNativeCachingStrategy":true,"forceSimulatorSoftwareKeyboardPresence":true}],"alwaysMatch":{}}}[debug] [WD Proxy] Got response with status 200: {"value":{"sessionId":"DABECD83-9E85-426A-8303-07D94C1785C5","capabilities":{"device":"iphone","browserName":"RQBuzz","sdkVersion":"16.0","CFBundleIdentifier":"com.reliaquest.rqfirst"}},"sessionId":"DABECD83-9E85-426A-8303-07D94C1785C5"}
[info] [WD Proxy] Determined the downstream protocol as 'W3C'
[debug] [BaseDriver] Event 'wdaSessionStarted' logged at 1665146018916 (13:33:38 GMT+0100 (Irish Standard Time))
[debug] [BaseDriver] Event 'wdaStarted' logged at 1665146018916 (13:33:38 GMT+0100 (Irish Standard Time))
[info] [XCUITest] Skipping setting of the initial display orientation. Set the "orientation" capability to either "LANDSCAPE" or "PORTRAIT", if this is an undesired behavior.
[debug] [BaseDriver] Event 'orientationSet' logged at 1665146018917 (13:33:38 GMT+0100 (Irish Standard Time))
[debug] [BaseDriver] The value of 'elementResponseAttributes' setting did not change. Skipping the update for it
[debug] [BaseDriver] The value of 'shouldUseCompactResponses' setting did not change. Skipping the update for it
[debug] [WD Proxy] Matched '/session/b0cdd4be-1ae5-4056-956b-b4588813155b' to command name 'deleteSession'
[debug] [WD Proxy] Proxying [DELETE /session/b0cdd4be-1ae5-4056-956b-b4588813155b] to [DELETE http://127.0.0.1:8100/session/DABECD83-9E85-426A-8303-07D94C1785C5] with no body
[debug] [WD Proxy] Got response with status 200: {"value":null,"sessionId":null}
[info] [DevCon Factory] Releasing connections for 15FC87B5-38ED-4C88-BF90-68C916FE2C6B device on any port number
[info] [DevCon Factory] Found cached connections to release: ["15FC87B5-38ED-4C88-BF90-68C916FE2C6B:8100"]
[debug] [DevCon Factory] Cached connections count: 0
[debug] [XCUITest] Not clearing log files. Use `clearSystemFiles` capability to turn on.
[debug] [IOSSimulatorLog] Stopping iOS log capture
[debug] [FlutterDriver] Deleting Flutter Driver session
[debug] [BaseDriver] Event 'newSessionStarted' logged at 1665146018934 (13:33:38 GMT+0100 (Irish Standard Time))
[debug] [W3C] Encountered internal error running command: TypeError: Cannot read property 'match' of undefined
[debug] [W3C]     at Object.exports.processLogToGetobservatory (/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-flutter-driver/build/driver/lib/sessions/observatory.js:118:9)
[debug] [W3C]     at Object.exports.getObservatoryWsUri (/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-flutter-driver/lib/sessions/ios.ts:77:21)
[debug] [W3C]     at Object.exports.startIOSSession (/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-flutter-driver/lib/sessions/ios.ts:31:30)
[debug] [W3C]     at processTicksAndRejections (internal/process/task_queues.js:85:5)
[debug] [W3C]     at FlutterDriver.exports.createSession (/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-flutter-driver/lib/sessions/session.ts:15:47)
[debug] [W3C]     at AppiumDriver.createSession (/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/lib/appium.js:387:35)
[info] [HTTP] <-- POST /wd/hub/session 500 2808 ms - 667
[info] [HTTP] [debug] [WebDriverAgent] Parsed BUILD_DIR configuration value: '
Library/Developer/Xcode/DerivedData/WebDriverAgent-aghlrsejdreqngftgvcqwnjgrbou/Build/Products'
[debug] [WebDriverAgent] Got derived data root: '
/Library/Developer/Xcode/DerivedData/WebDriverAgent-aghlrsejdreqngftgvcqwnjgrbou'

Also, "npm i -g appium@next" isn't installing appium 2.0 on my machine

KazuCocoa commented 2 years ago

Also, "npm i -g appium@next" isn't installing appium 2.0 on my machine

hm, what message was raised? As https://www.npmjs.com/package/appium, next tag has 2.0.0-beta

KazuCocoa commented 2 years ago

Please share the npm install log (maybe debug flag may help) if still something error occurred