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

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?

Related

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

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

Error: 'null' cannot be coerced to a valid version number

Appium server is showing the 'null' cannot be coerced to a valid version number error.
Following are DesiredCapabilities that i have used
DesiredCapabilities caps = new DesiredCapabilities();
caps.setCapability(MobileCapabilityType.UDID, udid);
caps.setCapability(MobileCapabilityType.NO_RESET, noReset);
caps.setCapability(MobileCapabilityType.NEW_COMMAND_TIMEOUT, 600);
caps.setCapability(MobileCapabilityType.PLATFORM_NAME, MobilePlatform.IOS);
caps.setCapability(MobileCapabilityType.DEVICE_NAME, "iPhone");
caps.setCapability(MobileCapabilityType.APP, app.getAbsolutePath());
caps.setCapability(MobileCapabilityType.AUTOMATION_NAME, "XCUITest");
caps.setCapability("xcodeOrgId", myXcodeOrgId);
caps.setCapability("xcodeSigningId", "iPhone Developer");
caps.setCapability("showXcodeLog", true);
driver = new IOSDriver(new URL("http://" + host + ":" + port + "/wd/hub"), caps);
Following is the appium server log:
Creating session with W3C capabilities: {"alwaysMatch":{"platformNa...
[BaseDriver] Session created with session id: 77cbca4b-157d-462e-ab26-5cc9cc47c7a9
[debug] [XCUITest] Current user: 'infotmt'
[XCUITest] Error: 'null' cannot be coerced to a valid version number
[XCUITest] at coerceVersion (/usr/local/lib/node_modules/appium/node_modules/appium-support/lib/util.js:241:11)
[XCUITest] at Object.coerceVersion [as compareVersions] (/usr/local/lib/node_modules/appium/node_modules/appium-support/lib/util.js:268:35)
[XCUITest] at XCUITestDriver.compareVersions [as start] (/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/lib/driver.js:263:14)
[debug] [XCUITest] Not clearing log files. Use `clearSystemFiles` capability to turn on.
[debug] [BaseDriver] Event 'newSessionStarted' logged at 1553847186978 (13:58:06 GMT+0545 (Nepal Time))
[debug] [W3C] Encountered internal error running command: Error: 'null' cannot be coerced to a valid version number
[debug] [W3C] at coerceVersion (/usr/local/lib/node_modules/appium/node_modules/appium-support/lib/util.js:241:11)
[debug] [W3C] at Object.coerceVersion [as compareVersions] (/usr/local/lib/node_modules/appium/node_modules/appium-support/lib/util.js:268:35)
[debug] [W3C] at XCUITestDriver.compareVersions [as start] (/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/lib/driver.js:263:14)
[HTTP] <-- POST /wd/hub/session 500 29 ms - 597
[HTTP]
I am using
Appium server version - 1.12.1
Java client Version - 7.0.0
In Appium 1.12.1 the platformVersion must be set. Code to be added:
caps.setCapability("platformVersion", "12.2");
The 12.2 is the version of the iOS.

Error: 'browserName' cannot be set together with 'bundleId' capability - Appium - iOS

I am automating iOS application using appium. I have provided following capabilites in order to start application.
DesiredCapabilities caps = null;
caps = DesiredCapabilities.iphone();
caps.setCapability(MobileCapabilityType.DEVICE_NAME, "iPhone 5s");
caps.setCapability(MobileCapabilityType.PLATFORM_NAME, "IOS");
caps.setCapability(MobileCapabilityType.PLATFORM_VERSION, "11.2.6");
caps.setCapability("newCommandTimeout", 2500);
caps.setCapability(MobileCapabilityType.NO_RESET, true);
caps.setCapability("udid", ebf79af8d3777b13fdfd9fc190424fdbfa869af9);
caps.setCapability(IOSMobileCapabilityType.AUTO_ACCEPT_ALERTS, true);
caps.setCapability(IOSMobileCapabilityType.UNEXPECTED_ALERT_BEHAVIOUR, true);
caps.setCapability("autoAcceptAlerts", true);
caps.setCapability("bundleId", "XXX.XXX.XXX.XXXX");
caps.setCapability(MobileCapabilityType.AUTOMATION_NAME, "XCUITest");
iOSDriver = new AppiumDriver<MobileElement>(new URL("http://127.0.0.1:4723/wd/hub"), caps);
The script runs fine on simulator replacing bundle id with app capability.
In my real device, I have already installed the app and I don't want to give the app path. Hence I am using bundle id to start the app. However, Fail to start. I have not given browserName but still taking it. From where it is picking? Can you help to identify the issue?
Here is the appium log for real device run
[BaseDriver] The capabilities ["platform","unexpectedAlertBehaviour","version"] are not standard capabilities and should have an extension prefix
[Appium] Creating new XCUITestDriver (v2.94.2) session
[Appium] Capabilities:
[Appium] browserName: iPhone
[Appium] platform: MAC
[Appium] platformName: ios
[Appium] unexpectedAlertBehaviour: true
[Appium] unhandledPromptBehavior: true
[Appium] version:
[Appium] autoAcceptAlerts: true
[Appium] automationName: XCUITest
[Appium] bundleId: XXX.XXX.XXX.XXXX
[Appium] deviceName: iPhone 5s
[Appium] newCommandTimeout: 2500
[Appium] noReset: true
[Appium] platformVersion: 11.2.6
[Appium] udid: ebf79af8d3777b13fdfd9fc190424fdbfa869af9
[debug] [BaseDriver] W3C capabilities {"alwaysMatch":{"browserNam... and MJSONWP desired capabilities {"noReset":true,"bundleId":... were provided
[debug] [BaseDriver] Creating session with W3C capabilities: {"alwaysMatch":{"browserNam...
[BaseDriver] The following capabilities were provided, but are not recognized by appium: unhandledPromptBehavior, platform, unexpectedAlertBehaviour, version.
[XCUITest] Error: 'browserName' cannot be set together with 'bundleId' capability
[XCUITest] at Object.wrappedLogger.errorAndThrow (/usr/local/lib/node_modules/appium/node_modules/appium-support/lib/logging.js:78:13)
[XCUITest] at XCUITestDriver.validateDesiredCaps (/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/lib/driver.js:947:13)
[XCUITest] at XCUITestDriver.callee$0$0$ (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/basedriver/commands/session.js:45:8)
[XCUITest] at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
[XCUITest] at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
[XCUITest] at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
[XCUITest] at invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
[XCUITest] at enqueueResult (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:185:17)
[XCUITest] at new Promise (<anonymous>)
[XCUITest] at new F (/usr/local/lib/node_modules/appium/node_modules/core-js/library/modules/$.export.js:30:36)
[XCUITest] at AsyncIterator.enqueue (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:184:12)
[XCUITest] at AsyncIterator.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
[XCUITest] at Object.runtime.async (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:209:12)
[XCUITest] at XCUITestDriver.callee$0$0 [as createSession] (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/build/lib/basedriver/commands/session.js:35:30)
[XCUITest] at XCUITestDriver.createSession$ (/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/lib/driver.js:111:21)
[XCUITest] at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
[XCUITest] at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
[XCUITest] at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
[XCUITest] at invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
[XCUITest] at enqueueResult (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:185:17)
[XCUITest] at new Promise (<anonymous>)
[XCUITest] at new F (/usr/local/lib/node_modules/appium/node_modules/core-js/library/modules/$.export.js:30:36)
[XCUITest] at AsyncIterator.enqueue (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:184:12)
[XCUITest] at AsyncIterator.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
[XCUITest] at Object.runtime.async (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:209:12)
[XCUITest] at XCUITestDriver.createSession (/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/build/lib/driver.js:247:34)
[XCUITest] at AppiumDriver.callee$2$0$ (/usr/local/lib/node_modules/appium/lib/appium.js:291:43)
[XCUITest] at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
[XCUITest] at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
[XCUITest] at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
[XCUITest] at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
[XCUITest] at <anonymous>
[XCUITest] at process._tickCallback (internal/process/next_tick.js:188:7)
[XCUITest] Error: 'browserName' cannot be set together with 'bundleId' capability
[XCUITest] at Object.wrappedLogger.errorAndThrow (/usr/local/lib/node_modules/appium/node_modules/appium-support/lib/logging.js:78:13)
[XCUITest] at XCUITestDriver.validateDesiredCaps (/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/lib/driver.js:947:13)
[XCUITest] at XCUITestDriver.callee$0$0$ (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/basedriver/commands/session.js:45:8)
[XCUITest] at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
[XCUITest] at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
[XCUITest] at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
[XCUITest] at invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
[XCUITest] at enqueueResult (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:185:17)
[XCUITest] at new Promise (<anonymous>)
[XCUITest] at new F (/usr/local/lib/node_modules/appium/node_modules/core-js/library/modules/$.export.js:30:36)
[XCUITest] at AsyncIterator.enqueue (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:184:12)
[XCUITest] at AsyncIterator.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
[XCUITest] at Object.runtime.async (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:209:12)
[XCUITest] at XCUITestDriver.callee$0$0 [as createSession] (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/build/lib/basedriver/commands/session.js:35:30)
[XCUITest] at XCUITestDriver.createSession$ (/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/lib/driver.js:111:21)
[XCUITest] at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
[XCUITest] at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
[XCUITest] at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
[XCUITest] at invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
[XCUITest] at enqueueResult (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:185:17)
[XCUITest] at new Promise (<anonymous>)
[XCUITest] at new F (/usr/local/lib/node_modules/appium/node_modules/core-js/library/modules/$.export.js:30:36)
[XCUITest] at AsyncIterator.enqueue (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:184:12)
[XCUITest] at AsyncIterator.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
[XCUITest] at Object.runtime.async (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:209:12)
[XCUITest] at XCUITestDriver.createSession (/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/build/lib/driver.js:247:34)
[XCUITest] at AppiumDriver.callee$2$0$ (/usr/local/lib/node_modules/appium/lib/appium.js:291:43)
[XCUITest] at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
[XCUITest] at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
[XCUITest] at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
[XCUITest] at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
[XCUITest] at <anonymous>
[XCUITest] at process._tickCallback (internal/process/next_tick.js:188:7)
[debug] [XCUITest] Not clearing log files. Use `clearSystemFiles` capability to turn on.
[debug] [BaseDriver] Event 'newSessionStarted' logged at 1539752480946 (10:31:20 GMT+0530 (IST))
[debug] [W3C] Encountered internal error running command: Error: 'browserName' cannot be set together with 'bundleId' capability
[debug] [W3C] at Object.wrappedLogger.errorAndThrow (/usr/local/lib/node_modules/appium/node_modules/appium-support/lib/logging.js:78:13)
[debug] [W3C] at XCUITestDriver.validateDesiredCaps (/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/lib/driver.js:947:13)
[debug] [W3C] at XCUITestDriver.callee$0$0$ (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/basedriver/commands/session.js:45:8)
[debug] [W3C] at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
[debug] [W3C] at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
[debug] [W3C] at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
[debug] [W3C] at invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
[debug] [W3C] at enqueueResult (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:185:17)
[debug] [W3C] at new Promise (<anonymous>)
[debug] [W3C] at new F (/usr/local/lib/node_modules/appium/node_modules/core-js/library/modules/$.export.js:30:36)
[debug] [W3C] at AsyncIterator.enqueue (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:184:12)
[debug] [W3C] at AsyncIterator.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
[debug] [W3C] at Object.runtime.async (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:209:12)
[debug] [W3C] at XCUITestDriver.callee$0$0 [as createSession] (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/build/lib/basedriver/commands/session.js:35:30)
[debug] [W3C] at XCUITestDriver.createSession$ (/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/lib/driver.js:111:21)
[debug] [W3C] at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
[debug] [W3C] at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
[debug] [W3C] at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
[debug] [W3C] at invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
[debug] [W3C] at enqueueResult (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:185:17)
[debug] [W3C] at new Promise (<anonymous>)
[debug] [W3C] at new F (/usr/local/lib/node_modules/appium/node_modules/core-js/library/modules/$.export.js:30:36)
[debug] [W3C] at AsyncIterator.enqueue (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:184:12)
[debug] [W3C] at AsyncIterator.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
[debug] [W3C] at Object.runtime.async (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:209:12)
[debug] [W3C] at XCUITestDriver.createSession (/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/build/lib/driver.js:247:34)
[debug] [W3C] at AppiumDriver.callee$2$0$ (/usr/local/lib/node_modules/appium/lib/appium.js:291:43)
[debug] [W3C] at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
[debug] [W3C] at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
[debug] [W3C] at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
[debug] [W3C] at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
[debug] [W3C] at <anonymous>
[debug] [W3C] at process._tickCallback (internal/process/next_tick.js:188:7)
[HTTP] <-- POST /wd/hub/session 500 27 ms - 1277
[HTTP]
The culprit here for adding browserName capability is this line,
caps = DesiredCapabilities.iphone();
Instead, initialize with an empty DesiredCapabilities like,
DesiredCapabilities caps = new DesiredCapabilities ();
When we automate web application then we need to specify browserName else only bundleId and not both.

Appium: Waiting for elements on iOS doesn't work anymore

I'm automizing tests for Android and iOS. Lately (probably after I've updated to appium 1.9.1 and java-client 6.1.0) I have issues with the iOS tests.
Many tests fail, because WebElements couldn't be found. I'm using WebDriverWait to find elements like in this example:
private WebElement getWebElement(By by, int timeOutInSeconds) {
return (new WebDriverWait(appiumDriver, timeOutInSeconds)).until(ExpectedConditions.presenceOfElementLocated(by));
}
The tests don't wait to find the element anymore. Instead an exception is thrown immediately.
I'm using XCUITest for iOS and uiautomator2 on android. On android the tests are still fine.
Edit (2018-10-29 18:33):
It feels like page factory is reporting the element is there, then randomElement.isDisplayed() will be executed on the element which throws directly an error, because it can't find the element.
And another observation:
In some cases the waiting duration works properly on iOS, but I couldn't find a pattern yet.
Edit (2018-12-14 15:56):
Still no solution found. Note: My tests make screenshots on failure. I can see on a lot of screenshots, the elements that caused the failure. The logs say they couldn't be found, but I can clearly see them on the screen. Makes no sense. Hoping for ideas!
Edit (2019-01-11 15:05):
In the logs, it looks like the element is found (response 200), but when I want to perform a click, it says it's 'not visible on the screen an thus not interactable'.
...
[HTTP] --> POST /wd/hub/session/59e9ace4-55a5-4b07-ad0e-af874dc42a6d/element
[HTTP] {"using":"id","value":"myapp"}
[debug] [W3C] Calling AppiumDriver.findElement() with args: ["id","buttonNext","59e9ace4-55a5-4b07-ad0e-af874dc42a6d"]
[debug] [XCUITest] Executing command 'findElement'
[debug] [BaseDriver] Valid locator strategies for this request: xpath, id, name, class name, -ios predicate string, -ios class chain, accessibility id
[debug] [BaseDriver] Waiting up to 0 ms for condition
[debug] [JSONWP Proxy] Matched '/element' to command name 'findElement'
[debug] [JSONWP Proxy] Proxying [POST /element] to [POST http://localhost:8100/session/CE691ADA-FC54-48AE-9AA0-1DA6212DB2CC/element] with body: {"using":"id","value":"buttonNext"}
[debug] [JSONWP Proxy] Got response with status 200: {"value":{"ELEMENT":"24010000-0000-0000-0308-000000000000"},"sessionId":"CE691ADA-FC54-48AE-9AA0-1DA6212DB2CC","status":0}
[debug] [W3C] Responding to client with driver.findElement() result: {"element-6066-11e4-a52e-4f735466cecf":"24010000-0000-0000-0308-000000000000"}
[HTTP] <-- POST /wd/hub/session/59e9ace4-55a5-4b07-ad0e-af874dc42a6d/element 200 180 ms - 88
[HTTP]
[HTTP] --> POST /wd/hub/session/59e9ace4-55a5-4b07-ad0e-af874dc42a6d/element/24010000-0000-0000-0308-000000000000/click
[HTTP] {"id":"24010000-0000-0000-0308-000000000000"}
[W3C] Driver proxy active, passing request on via HTTP proxy
[debug] [XCUITest] Executing command 'proxyReqRes'
[debug] [JSONWP Proxy] Matched '/wd/hub/session/59e9ace4-55a5-4b07-ad0e-af874dc42a6d/element/24010000-0000-0000-0308-000000000000/click' to command name 'click'
[debug] [JSONWP Proxy] Proxying [POST /wd/hub/session/59e9ace4-55a5-4b07-ad0e-af874dc42a6d/element/24010000-0000-0000-0308-000000000000/click] to [POST http://localhost:8100/session/CE691ADA-FC54-48AE-9AA0-1DA6212DB2CC/element/24010000-0000-0000-0308-000000000000/click] with body: {"id":"24010000-0000-0000-0308-000000000000"}
[debug] [JSONWP Proxy] Got response with status 200: {"value":"Error Domain=com.facebook.WebDriverAgent Code=1 \"The element '\"buttonNext\" Button' is not visible on the screen and thus is not interactable\" UserInfo={NSLocalizedDescription=The element '\"buttonNext\" Button' is not visible on the screen and thus is not interactable}","sessionId":"CE691ADA-FC54-48AE-9AA0-1DA6212DB2CC","status":13}
[debug] [W3C] Encountered internal error running command: ProxyRequestError: Could not proxy command to remote server. Original error: The request to /wd/hub/session/59e9ace4-55a5-4b07-ad0e-af874dc42a6d/element/24010000-0000-0000-0308-000000000000/click has failed
[debug] [W3C] at JWProxy.proxy$ (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/jsonwp-proxy/proxy.js:182:13)
[debug] [W3C] at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
[debug] [W3C] at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
[debug] [W3C] at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
[debug] [W3C] at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
[debug] [MJSONWP] Matched JSONWP error code 13 to UnknownError
[HTTP] <-- POST /wd/hub/session/59e9ace4-55a5-4b07-ad0e-af874dc42a6d/element/24010000-0000-0000-0308-000000000000/click 500 4875 ms - 1779
[HTTP]
[HTTP] --> GET /wd/hub/session/59e9ace4-55a5-4b07-ad0e-af874dc42a6d/screenshot
[HTTP] {}
...

Getting error HTTP Status: '404' -> incorrect JSON status mapping for 'unknown method' (405 expected) for using Appium with class AndroidTouchAction

I using Appium for automation mobile chrome browser on a real device. I need to swipe on a webelement. I have used below script for it
AndroidTouchAction action = new AndroidTouchAction (driver);
action.press(PointOption.point(00, 00)).moveTo(PointOption.point(100, 100)).release().perform();
System.out.println("Test");
I got the below error in eclipse after execution
INFO: HTTP Status: '404' -> incorrect JSON status mapping for 'unknown
method' (405 expected)
So the swipe operation is not completed. What is wrong here?
Below are the Appium logs
[W3C] Calling AppiumDriver.performTouch() with args:
[[{"action":"press","options":{"x":0,"y":0}},{"action":"moveTo","options":{"x":100,"y":100}},{"action":"release","options":{}}],"a6425cfd-df0b-490e-a30c-a3ef8c5b3424"]
[W3C] Encountered internal error running command:
NotYetImplementedError: Method has not yet been implemented [W3C]
at AndroidDriver.callee$0$0$
(C:\Users\chints\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-android-driver\lib\commands\touch.js:136:11)
[W3C] at tryCatch
(C:\Users\chints\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:67:40)
[W3C] at GeneratorFunctionPrototype.invoke [as _invoke]
(C:\Users\chints\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:315:22)
[W3C] at GeneratorFunctionPrototype.prototype.(anonymous function)
[as next]
(C:\Users\chints\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:100:21)
[W3C] at invoke
(C:\Users\chints\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:136:37)
[W3C] at enqueueResult
(C:\Users\chints\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:185:17)
[W3C] at new Promise () [W3C] at new F
(C:\Users\chints\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\core-js\library\modules\$.export.js:30:36)
[W3C] at AsyncIterator.enqueue
(C:\Users\chints\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:184:12)
[W3C] at AsyncIterator.prototype.(anonymous function) [as next]
(C:\Users\chints\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:100:21)
[W3C] at Object.runtime.async
(C:\Users\chints\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:209:12)
[W3C] at AndroidDriver.callee$0$0 [as performTouch]
(C:\Users\chints\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-android-driver\build\lib\commands\touch.js:375:30)
[W3C] at
C:\Users\chints\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-base-driver\lib\basedriver\driver.js:296:26
[W3C] at tryCatcher
(C:\Users\chints\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-base-driver\node_modules\bluebird\js\main\util.js:26:23)
[W3C] at Promise._settlePromiseFromHandler
(C:\Users\chints\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-base-driver\node_modules\bluebird\js\main\promise.js:510:31)
[W3C] at Promise._settlePromiseAt
(C:\Users\chints\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-base-driver\node_modules\bluebird\js\main\promise.js:584:18)
[W3C] at Promise._settlePromiseAtPostResolution
(C:\Users\chints\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-base-driver\node_modules\bluebird\js\main\promise.js:248:10)
[W3C] at Async._drainQueue
(C:\Users\chints\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-base-driver\node_modules\bluebird\js\main\async.js:128:12)
[W3C] at Async._drainQueues
(C:\Users\chints\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-base-driver\node_modules\bluebird\js\main\async.js:133:10)
[W3C] at Immediate.Async.drainQueues [as _onImmediate]
(C:\Users\chints\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-base-driver\node_modules\bluebird\js\main\async.js:15:14)
[W3C] at runCallback (timers.js:789:20) [W3C] at
tryOnImmediate (timers.js:751:5) [W3C] at processImmediate [as
_immediateCallback] (timers.js:722:5) [HTTP] <-- POST /wd/hub/session/a6425cfd-df0b-490e-a30c-a3ef8c5b3424/touch/perform 404
7 ms - 4202
Firstly make sure you are using latest stable version of Appium server 1.9.1 and Java client 6.1.0.
Now when swiping, don't start from x: 0, y: 0.
Try starting from x: 5, y: 5 instead.
This should work since Appium causes issues when starting from the border of the device.

Resources