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

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.

Related

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?

How to inspect windows application using Appium

Is it possible to inspect a Windows application using Appium?
If yes can someone show me what "Desired Capability" shall be set to launch for example notepad?
What I have done is:
Installed/Started Appium
Launched server on 0.0.0.0:4723
Clicked on start inspector
Provided following capabilities:
{
"platformName": "Windows",
"deviceName": "WindowsPC",
"app": "C:\Windows\System32\notepad.exe"
}
What i got back is the following log:
[HTTP] --> POST /wd/hub/session
[HTTP] {"desiredCapabilities":{"app":"C:\\Windows\\System32\\notepad.exe","deviceName":"WindowsPC","platformName":"Windows","newCommandTimeout":0,"connectHardwareKeyboard":true}}
[MJSONWP] Calling AppiumDriver.createSession() with args: [{"app":"C:\\Windows\\System32\\notepad.exe","deviceName":"WindowsPC","platformName":"Windows","newCommandTimeout":0,"connectHardwareKeyboard":true},null,null]
[BaseDriver] Event 'newSessionRequested' logged at 1562752317506 (11:51:57 GMT+0200 (W. Europe Daylight Time))
[Appium] Appium v1.14.0 creating new WindowsDriver (v1.5.1) session
[Appium] Capabilities:
[Appium] app: C:\Windows\System32\notepad.exe
[Appium] deviceName: WindowsPC
[Appium] platformName: Windows
[Appium] newCommandTimeout: 0
[Appium] connectHardwareKeyboard: true
[BaseDriver] Creating session with MJSONWP desired capabilities: {"app":"C:\\Windows\\System...
[BaseDriver] The following capabilities were provided, but are not recognized by Appium:
[BaseDriver] app
[BaseDriver] connectHardwareKeyboard
[BaseDriver] Session created with session id: b4f9003f-6a56-47b8-b9f3-bf70ac3dc91d
[WinAppDriver] You must use WinAppDriver version 1.1
[WinAppDriver] Verifying WinAppDriver version 1.1 is installed via comparing the checksum.
[WinAppDriver] Deleting WinAppDriver session
[BaseDriver] Event 'newSessionStarted' logged at 1562752317614 (11:51:57 GMT+0200 (W. Europe Daylight Time))
[MJSONWP] Encountered internal error running command: Error: Could not verify WinAppDriver install; re-run install
[MJSONWP] at C:\Users\myUser\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-windows-driver\lib\winappdriver.js:35:13
[MJSONWP] at Generator.next ()
[MJSONWP] at asyncGeneratorStep (C:\Users\myUser\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\#babel\runtime\helpers\asyncToGenerator.js:3:24)
[MJSONWP] at _next (C:\Users\myUser\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\#babel\runtime\helpers\asyncToGenerator.js:25:9)
[MJSONWP] at run (C:\Users\myUser\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\core-js\modules\es6.promise.js:75:22)
[MJSONWP] at C:\Users\myUser\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\core-js\modules\es6.promise.js:92:30
[MJSONWP] at flush (C:\Users\myUser\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\core-js\modules\_microtask.js:18:9)
[MJSONWP] at process._tickCallback (internal/process/next_tick.js:61:11)
[HTTP] <-- POST /wd/hub/session 500 113 ms - 190
[HTTP]
[HTTP] --> DELETE /wd/hub/session
[HTTP] {}
[HTTP] No route found. Setting content type to 'text/plain'
[HTTP] <-- DELETE /wd/hub/session 404 1 ms - 57
Uninstalling and reinstalling did not help.
Am i doing anything wrong? Shall windows driver be started manually?
you can run the selenium server from the windows command prompt like
C:\Users\Administrator> “C:\Program Files (x86)\Windows Application Driver\WinAppDriver.exe” 4723/wd/hub
after the server is running. Use breakpoints in your visual studio and then start debugging. When you start debugging, you will see sessionID in your command window. copy that session ID
open appium > File > new session window > custom server > attach to session > paste the session Id > click "attach to session" >
you will get your result. (appium takes some time to grab the current session).

WDA Connection Time Out with Appium 1.10.0 & IOS (12.1.2)

Please , I need your help about one problem :
I obtain this message error with appium "WDA connection timeout" when I launched my tests automated from IPhone 6+ with version system (12.1.2) . I use XCode 10.1 and the WebDriverAgent is installed with success on my IPhone.I join you a part of logs Appium :
[XCUITest] Connection to WDA timed out
[iProxy] recv failed: Operation not permitted
[HTTP] --> POST /wd/hub/session/117cd327-7c9e-4888-971e-76b6c4c25237/timeouts
[HTTP] {"implicit":80000}
[W3C (117cd327)] Calling AppiumDriver.timeouts() with args: [null,null,null,null,80000,"117cd327-7c9e-4888-971e-76b6c4c25237"]
[XCUITest] Executing command 'timeouts'
[BaseDriver] W3C timeout argument: {"implicit":80000}}
[BaseDriver] Set implicit wait to 80000ms
[W3C (117cd327)] Responding to client with driver.timeouts() result: null
[HTTP] <-- POST /wd/hub/session/117cd327-7c9e-4888-971e-76b6c4c25237/timeouts 200 3 ms - 14
[HTTP]
[HTTP] --> POST /wd/hub/session/117cd327-7c9e-4888-971e-76b6c4c25237/timeouts
[HTTP] {"implicit":300000}
[W3C (117cd327)] Calling AppiumDriver.timeouts() with args: [null,null,null,null,300000,"117cd327-7c9e-4888-971e-76b6c4c25237"]
[XCUITest] Executing command 'timeouts'
[BaseDriver] W3C timeout argument: {"implicit":300000}}
[BaseDriver] Set implicit wait to 300000ms
[W3C (117cd327)] Responding to client with driver.timeouts() result: null
[HTTP] <-- POST /wd/hub/session/117cd327-7c9e-4888-971e-76b6c4c25237/timeouts 200 3 ms - 14
[HTTP]
[HTTP] --> POST /wd/hub/session/117cd327-7c9e-4888-971e-76b6c4c25237/touch/perform
[HTTP] {"actions":[{"action":"tap","options":{"x":220,"y":417}}]}
[W3C (117cd327)] Calling AppiumDriver.performTouch() with args: [[{"action":"tap","options":{"x":220,"y":417}}],"117cd327-7c9e-4888-971e-76b6c4c25237"]
and :
[XCUITest] WebDriverAgent information:
[XCUITest] {
[XCUITest] "state": "success",
[XCUITest] "os": {
[XCUITest] "name": "iOS",
[XCUITest] "version": "12.1.2"
[XCUITest] },
[XCUITest] "ios": {
[XCUITest] "simulatorVersion": "12.1.2",
[XCUITest] "ip": null
[XCUITest] },
[XCUITest] "build": {
[XCUITest] "time": "Jan 30 2019 12:28:16"
[XCUITest] }
Before, I haven't this problem because I used XCode 9.2 and appium 1.7 and version system ios (11.2.6).
I had read many answers for other problems that like the mine but I didn't find the solution.
Thank you very much in Advance,
Best Regards,

Appium takes more than 5 min to get response while automating iOS app

I Have observed that when I first time run my script that will run very fast without any delay response. However, immediately, if I run the same script without any changes or closing simulator or any kind of reset, following POST request takes more than 5 min to get a response.
Request from Appium:
[debug] [JSONWP Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"desiredCapabilities":{"bundleId":"XXX.XXXX.ios","arguments":[],"environment":{},"shouldWaitForQuiescence":true,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true}}
Response:
[debug] [JSONWP Proxy] Got response with status 200: {"value":{"sessionId":"91784C9C-3B63-40D3-9335-9C80548E7E68","capabilities":{"device":"iphone","browserName":null,"sdkVersion":"11.4","CFBundleIdentifier":null}},"sessionId":"91784C9C-3B63-40D3-9335-9C80548E7E68","status":0}
Following are my configured version
Xcode Version: Xcode 9.4.1, Build version 9F2000
Appium: v1.8.1 also
tried with v1.9.1
node: 5.6.0
Javac: javac 1.8.0_171
Device: Simulator (iPhone 7)
Appium Java-client: 6.1.0
Full Appium log:
[HTTP] --> POST /wd/hub/session
[HTTP] {"desiredCapabilities":{"app":"/Users/user.name/Desktop/XXXXX.app","noReset":false,"unhandledPromptBehavior":true,"deviceName":"iPhone 7","version":"","platform":"MAC","newCommandTimeout":1500,"platformVersion":"11.4","automationName":"XCUITest","browserName":"iPhone","platformName":"IOS","udid":"7B7A3A94-372F-4872-8BD0-F7BC50CA2924","autoAcceptAlerts":true,"unexpectedAlertBehaviour":true},"capabilities":{"alwaysMatch":{"appium:app":"/Users/user.name/Desktop/XXXXX.app","appium:autoAcceptAlerts":true,"appium:automationName":"XCUITest","browserName":"iPhone","appium:deviceName":"iPhone 7","appium:newCommandTimeout":1500,"appium:noReset":false,"platform":"MAC","platformName":"ios","appium:platformVersion":"11.4","appium:udid":"7B7A3A94-372F-4872-8BD0-F7BC50CA2924","unexpectedAlertBehaviour":true,"unhandledPromptBehavior":true,"version":""},"firstMatch":[{}]}}
[debug] [W3C] Calling AppiumDriver.createSession() with args: [{"app":"/Users/user.name/Desktop/XXXXX.app","noReset":false,"unhandledPromptBehavior":true,"deviceName":"iPhone 7","version":"","platform":"MAC","newCommandTimeout":1500,"platformVersion":"11.4","automationName":"XCUITest","browserName":"iPhone","platformName":"IOS","udid":"7B7A3A94-372F-4872-8BD0-F7BC50CA2924","autoAcceptAlerts":true,"unexpectedAlertBehaviour":true},null,{"alwaysMatch":{"appium:app":"/Users/user.name/Desktop/XXXXX.app","appium:autoAcceptAlerts":true,"appium:automationName":"XCUITest","browserName":"iPhone","appium:deviceName":"iPhone 7","appium:newCommandTimeout":1500,"appium:noReset":false,"platform":"MAC","platformName":"ios","appium:platformVersion":"11.4","appium:udid":"7B7A3A94-372F-4872-8BD0-F7BC50CA2924","unexpectedAlertBehaviour":true,"unhandledPromptBehavior":true,"version":""},"firstMatch":[{}]}]
[debug] [BaseDriver] Event 'newSessionRequested' logged at 1539403642546 (09:37:22 GMT+0530 (IST))
[BaseDriver] The capabilities ["platform","unexpectedAlertBehaviour","version"] are not standard capabilities and should have an extension prefix
[Appium] Creating new XCUITestDriver (v2.84.0) session
[Appium] Capabilities:
[Appium] browserName: iPhone
[Appium] platform: MAC
[Appium] platformName: ios
[Appium] unexpectedAlertBehaviour: true
[Appium] unhandledPromptBehavior: true
[Appium] version:
[Appium] app: /Users/user.name/Desktop/XXXXX.app
[Appium] autoAcceptAlerts: true
[Appium] automationName: XCUITest
[Appium] deviceName: iPhone 7
[Appium] newCommandTimeout: 1500
[Appium] noReset: false
[Appium] platformVersion: 11.4
[Appium] udid: 7B7A3A94-372F-4872-8BD0-F7BC50CA2924
[debug] [BaseDriver] W3C capabilities {"alwaysMatch":{"browserNam... and MJSONWP desired capabilities [object Object] 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] The capabilities 'autoAcceptAlerts' and 'autoDismissAlerts' do not work for XCUITest-based tests. Please adjust your alert handling accordingly.
[BaseDriver] Session created with session id: 7b782b91-6f85-433d-b713-070a891c95f9
[debug] [XCUITest] Current user: 'user.name'
[debug] [XCUITest] Xcode version set to '9.4.1' (tools v9.4.0.0.1.1526532315)
[debug] [XCUITest] iOS SDK Version set to '11.4'
[debug] [BaseDriver] Event 'xcodeDetailsRetrieved' logged at 1539403642636 (09:37:22 GMT+0530 (IST))
[iOSSim] Constructing iOS simulator for Xcode version 9.4.1 with udid '7B7A3A94-372F-4872-8BD0-F7BC50CA2924'
[XCUITest] Determining device to run tests on: udid: '7B7A3A94-372F-4872-8BD0-F7BC50CA2924', real device: false
[BaseDriver] Using local app '/Users/user.name/Desktop/XXXXX.app'
[debug] [BaseDriver] Event 'appConfigured' logged at 1539403642857 (09:37:22 GMT+0530 (IST))
[debug] [XCUITest] Checking whether app '/Users/user.name/Desktop/XXXXX.app' is actually present on file system
[debug] [XCUITest] App is present
[debug] [iOS] Getting bundle ID from app '/Users/user.name/Desktop/XXXXX.app': 'XXX.XXXX.ios'
[debug] [BaseDriver] Event 'resetStarted' logged at 1539403642858 (09:37:22 GMT+0530 (IST))
[XCUITest] Not scrubbing third party app in anticipation of uninstall
[debug] [BaseDriver] Event 'resetComplete' logged at 1539403643079 (09:37:23 GMT+0530 (IST))
[debug] [XCUITest] Starting log capture for iOS Simulator with udid '7B7A3A94-372F-4872-8BD0-F7BC50CA2924', using 'xcrun simctl spawn 7B7A3A94-372F-4872-8BD0-F7BC50CA2924 log stream --style compact'
[debug] [BaseDriver] Event 'logCaptureStarted' logged at 1539403643385 (09:37:23 GMT+0530 (IST))
[XCUITest] Setting up simulator
[debug] [iOS] No reason to set locale
[debug] [iOS] No iOS / app preferences to set
[debug] [iOSSim] Matched 1 Simulator cache item for cleanup: /Users/user.name/Library/Developer/CoreSimulator/Devices/7B7A3A94-372F-4872-8BD0-F7BC50CA2924/data/Library/Caches/com.apple.mobile.installd.staging
[debug] [iOSSim] Setting preferences of 7B7A3A94-372F-4872-8BD0-F7BC50CA2924 Simulator to {"ConnectHardwareKeyboard":false}
[debug] [iOSSim] Setting common Simulator preferences to {"ConnectHardwareKeyboard":false}
[debug] [iOSSim] Updated 7B7A3A94-372F-4872-8BD0-F7BC50CA2924 Simulator preferences at '/Users/user.name/Library/Preferences/com.apple.iphonesimulator.plist' with {"DevicePreferences":{"7B7A3A94-372F-4872-8BD0-F7BC50CA2924":{"ConnectHardwareKeyboard":false}},"ConnectHardwareKeyboard":false}
[debug] [iOSSim] The count of running Simulator UI client instances is 1
[iOSSim] Both Simulator with UDID 7B7A3A94-372F-4872-8BD0-F7BC50CA2924 and the UI client are currently running
[debug] [BaseDriver] Event 'simStarted' logged at 1539403643658 (09:37:23 GMT+0530 (IST))
[debug] [XCUITest] Verifying application platform
[debug] [XCUITest] CFBundleSupportedPlatforms: ["iPhoneSimulator"]
[debug] [XCUITest] Reset requested. Removing app with id 'XXX.XXXX.ios' from the device
[debug] [XCUITest] Installing '/Users/user.name/Desktop/XXXXX.app' on Simulator with UUID '7B7A3A94-372F-4872-8BD0-F7BC50CA2924'...
[debug] [XCUITest] The app has been installed successfully.
[debug] [BaseDriver] Event 'appInstalled' logged at 1539403647212 (09:37:27 GMT+0530 (IST))
[XCUITest] Using WDA path: '/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent'
[XCUITest] Using WDA agent: '/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj'
[debug] [XCUITest] No obsolete cached processes from previous WDA sessions listening on port 8100 have been found
[debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[debug] [JSONWP Proxy] Got response with status 200: "{\n \"value\" : {\n \"state\" : \"success\",\n \"os\" : {\n \"name\" : \"iOS\",\n \"version\" : \"11.4\",\n \"sdkVersion\" : \"11.3\"\n },\n \"ios\" : {\n \"simulatorVersion\" : \"11.4\",\n \"ip\" : \"192.168.2.4\"\n },\n \"build\" : {\n \"upgradedAt\" : \"1539327134564\",\n \"time\" : \"Oct 12 2018 12:22:23\",\n \"productBundleIdentifier\" : \"com.facebook.WebDriverAgentRunner\"\n }\n },\n \"sessionId\" : \"163984B3-334E-4054-AB68-99D93F26F976\",\n \"status\" : 0\n}"
[XCUITest] Will reuse previously cached WDA instance at 'http://localhost:8100/'. Set the wdaLocalPort capability to a value different from 8100 if this is an undesired behavior.
[debug] [BaseDriver] Event 'wdaStartAttempted' logged at 1539403647303 (09:37:27 GMT+0530 (IST))
[XCUITest] Using provided WebdriverAgent at 'http://localhost:8100/'
[debug] [BaseDriver] Event 'wdaSessionAttempted' logged at 1539403647304 (09:37:27 GMT+0530 (IST))
[debug] [XCUITest] Sending createSession command to WDA
[debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[debug] [JSONWP Proxy] Got response with status 200: "{\n \"value\" : {\n \"state\" : \"success\",\n \"os\" : {\n \"name\" : \"iOS\",\n \"version\" : \"11.4\",\n \"sdkVersion\" : \"11.3\"\n },\n \"ios\" : {\n \"simulatorVersion\" : \"11.4\",\n \"ip\" : \"192.168.2.4\"\n },\n \"build\" : {\n \"upgradedAt\" : \"1539327134564\",\n \"time\" : \"Oct 12 2018 12:22:23\",\n \"productBundleIdentifier\" : \"com.facebook.WebDriverAgentRunner\"\n }\n },\n \"sessionId\" : \"163984B3-334E-4054-AB68-99D93F26F976\",\n \"status\" : 0\n}"
**[debug] [JSONWP Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"desiredCapabilities":{"bundleId":"XXX.XXXX.ios","arguments":[],"environment":{},"shouldWaitForQuiescence":true,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true}}**
[debug] [JSONWP Proxy] Got response with status 200: {"value":{"sessionId":"91784C9C-3B63-40D3-9335-9C80548E7E68","capabilities":{"device":"iphone","browserName":null,"sdkVersion":"11.4","CFBundleIdentifier":null}},"sessionId":"91784C9C-3B63-40D3-9335-9C80548E7E68","status":0}
[debug] [BaseDriver] Event 'wdaSessionStarted' logged at 1539403968659 (09:42:48 GMT+0530 (IST))
[debug] [BaseDriver] Event 'wdaStarted' logged at 1539403968659 (09:42:48 GMT+0530 (IST))
[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 1539403968660 (09:42:48 GMT+0530 (IST))
[Appium] New XCUITestDriver session created successfully, session 7b782b91-6f85-433d-b713-070a891c95f9 added to master session list
[debug] [BaseDriver] Event 'newSessionStarted' logged at 1539403968660 (09:42:48 GMT+0530 (IST))
[debug] [W3C] Responding to client with driver.createSession() result: {"capabilities":{"webStorageEnabled":false,"locationContextEnabled":false,"browserName":"iPhone","platform":"MAC","javascriptEnabled":true,"databaseEnabled":false,"takesScreenshot":true,"networkConnectionEnabled":false,"platformName":"ios","unhandledPromptBehavior":true,"unexpectedAlertBehaviour":true,"version":"","app":"/Users/user.name/Desktop/XXXXX.app","autoAcceptAlerts":true,"automationName":"XCUITest","deviceName":"iPhone 7","newCommandTimeout":1500,"noReset":false,"platformVersion":"11.4","udid":"7B7A3A94-372F-4872-8BD0-F7BC50CA2924"}}
Try to run your tests with capability noReset: true and don't close/start driver before each test: you can use driver.launchApp() simply to restart it.

Error in loading Appium XCUITEST driver

I am really stuck, any help will be appreciated...
I have installed the latest server version (1.6.0).
When I am checking the server version it is OK...
Asis-Mac-mini:/ asihizkiahu$ appium -v
1.6.0
Observe at the server version in the log attached, it indicates Appium v1.6.0-beta1 (wrong version)
Does this causes the error?
I get error...
[MJSONWP] Encountered internal error running command: Error: Could not navigate to webview; there are none!
Log with the wrong server:
[node, /Users/asihizkiahu/node_modules/appium/build/lib/main.js, --address, 127.0.0.1, --port, 4723]
Appium server started.
(node:13191) DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
[Appium] Welcome to Appium v1.6.0-beta1
[Appium] Non-default server args:
[Appium] address: '127.0.0.1'
[Appium] Appium REST http interface listener started on 127.0.0.1:4723
Trying to set IOS driver
Property file src/test/resources/messaging_sanity_test/capabilities.properties parsed successfully
[MJSONWP] Encountered internal error running command: Error: Could not navigate to webview; there are none!
Here is part of the log that contain the error:
[debug] [RemoteDebugger] Receiving data from remote debugger: '{"argument":{"WIRApplicationDictionaryKey":{}},"selector":"rpcreportConnectedApplicationList:"}'
[debug] [RemoteDebugger] Received no apps from remote debugger. Unable to connect.
[debug] [RemoteDebugger] Receiving data from remote debugger: '{"argument":{"WIRDriverDictionaryKey":{}},"selector":"rpcreportConnectedDriverList:"}'
[debug] [RemoteDebugger] Notified of connected drivers: {}.
[debug] [RemoteDebugger] Connected to application
[debug] [RemoteDebugger] Sim name: iPhone
[debug] [RemoteDebugger] Sim build: 14A345
[debug] [RemoteDebugger] Sim platform version: 10.0
[debug] [RemoteDebugger] Selecting application
[debug] [RemoteDebugger] No applications currently connected.
[debug] [iOS] No web frames found.
[iOS] Could not find any webviews yet, refreshing/retrying
[debug] [iOS] Retrieving contexts and views
[debug] [iOS] Selecting by url: false
[debug] [RemoteDebugger] useNewSafari --> false
[debug] [RemoteDebugger] Debugger socket connected to ::1:27753
[debug] [RemoteDebugger] Sending connection key request
[debug] [RemoteDebugger] Sending 'rpcreportIdentifier:' message to remote debugger
[debug] [RemoteDebugger] Receiving data from remote debugger: '{"argument":{"WIRSimulatorBuildKey":"14A345","WIRSimulatorProductVersionKey":"10.0","WIRSimulatorNameKey":"iPhone"},"selector":"rpcreportSetup:"}'
[debug] [RemoteDebugger] Received response from socket send: '["iPhone","14A345","10.0"]'
[debug] [RemoteDebugger] Receiving data from remote debugger: '{"argument":{"WIRApplicationDictionaryKey":{}},"selector":"rpcreportConnectedApplicationList:"}'
[debug] [RemoteDebugger] Received no apps from remote debugger. Unable to connect.
[debug] [RemoteDebugger] Connected to application
[debug] [RemoteDebugger] Sim name: iPhone
[debug] [RemoteDebugger] Sim build: 14A345
[debug] [RemoteDebugger] Sim platform version: 10.0
[debug] [RemoteDebugger] Selecting application
[debug] [RemoteDebugger] No applications currently connected.
[debug] [iOS] No web frames found.
[XCUITest] Error: Could not navigate to webview; there are none!
at XCUITestDriver.spinHandles$ (lib/commands/context.js:506:13)
at tryCatch (/Users/asihizkiahu/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke as _invoke
at GeneratorFunctionPrototype.prototype.(anonymous function) as next
at GeneratorFunctionPrototype.invoke (/Users/asihizkiahu/node_modules/babel-runtime/regenerator/runtime.js:136:37)
Error: Could not navigate to webview; there are none!
at XCUITestDriver.spinHandles$ (lib/commands/context.js:506:13)
at tryCatch (/Users/asihizkiahu/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke as _invoke
at GeneratorFunctionPrototype.prototype.(anonymous function) as next
at GeneratorFunctionPrototype.invoke (/Users/asihizkiahu/node_modules/babel-runtime/regenerator/runtime.js:136:37)
[JSONWP Proxy] Proxying [DELETE /session/34948802-75b5-4ee5-922f-20b4b658fa18] to [DELETE http://localhost:8100/session/E545A2AC-EB6F-4BD1-A419-DB6CF7B04987] with no body
[debug] [RemoteDebugger] Receiving data from remote debugger: '{"argument":{"WIRDriverDictionaryKey":{}},"selector":"rpcreportConnectedDriverList:"}'
[debug] [RemoteDebugger] Notified of connected drivers: {}.
[JSONWP Proxy] Got response with status 200: "{\n \"value\" : {\n\n },...
[XCUITest] Shutting down WebDriverAgent
[XCUITest] Simulator log exited with code 'null'
[XCUITest] xcodebuild exited with code 'null' and signal 'SIGTERM'
[debug] [XCUITest] Running iOS simulator reset flow
[debug] [XCUITest] Shutting down simulator
[debug] [iOSSim] Killing all iOS Simulators
[debug] [XCUITest] Full reset is on. Cleaning simulator
[debug] [iOSSim] Killing any simulator daemons for 5A494E7A-EE78-4095-8922-CF1C3CC89FAB
[iOSSim] Cleaning simulator 5A494E7A-EE78-4095-8922-CF1C3CC89FAB
[debug] [XCUITest] Resetting simulator
[debug] [XCUITest] Shutting down simulator
[debug] [iOSSim] Killing all iOS Simulators
[debug] [iOSLog] Stopping iOS log capture
[MJSONWP] Encountered internal error running command: Error: Could not navigate to webview; there are none!
at XCUITestDriver.spinHandles$ (lib/commands/context.js:506:13)
at tryCatch (/Users/asihizkiahu/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke as _invoke
at GeneratorFunctionPrototype.prototype.(anonymous function) as next
at GeneratorFunctionPrototype.invoke (/Users/asihizkiahu/node_modules/babel-runtime/regenerator/runtime.js:136:37)
[HTTP] <-- POST /wd/hub/session 500 305866 ms - 183
org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Could not navigate to webview; there are none! (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 306.28 seconds
Build info: version: '2.53.0', revision: '35ae25b1534ae328c771e0856c93e187490ca824', time: '2016-03-15 10:43:46'
System info: host: 'Asis-Mac-mini.local', ip: '192.168.1.194', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.11.6', java.version: '1.7.0_79'
Driver info: org.openqa.selenium.remote.RemoteWebDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:678)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:249)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:131)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:158)
at com.ui.service.drivers.Drivers$Appium.createIOSDriver(Drivers.java:474)
at com.ui.service.drivers.Drivers$Appium.setDriver(Drivers.java:420)
at com.ui.service.drivers.Drivers.setDriver(Drivers.java:59)
at com.test.BaseTest$StaticRouter.before(BaseTest.java:80)
at appium.messaging.MessagingSanityTest.setUp(MessagingSanityTest.java:123)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
My goal is to load the Appium server (version 1.6.0) via code, and to load the XCUITEST driver as well.
My code is...
Appium server load:
public static void startServer() {
CommandLine command = new CommandLine(
"node");
command.addArgument(
"/Users/asihizkiahu/node_modules/appium/build/lib/main.js",
false);
command.addArgument("--address", false);
command.addArgument("127.0.0.1");
command.addArgument("--port", false);
command.addArgument("4723");
// command.addArgument("---no-reset", true);
DefaultExecuteResultHandler resultHandler = new DefaultExecuteResultHandler();
DefaultExecutor executor = new DefaultExecutor();
executor.setExitValue(1);
try {
ColorLog.println(ColorLog.Level.DEBUG, command.toString());
executor.execute(command, resultHandler);
Thread.sleep(10000);
System.out.println("Appium server started.");
} catch (IOException e) {
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
driver load:
public class AppiumIOS {
private final static Logger logger = Logger.getLogger(AppiumIOS.class);
static WebDriver driver;
public static void main(String[] args) throws MalformedURLException, InterruptedException {
String hubUrl = "http://127.0.0.1:4723/wd/hub";
String iOSDeviceName = "iPhone Simulator";
String iOSVersion = "10.0";
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("deviceName", iOSDeviceName);
capabilities.setCapability("platformName", "iOS");
capabilities.setCapability("platformVersion", iOSVersion);
capabilities.setCapability("app", /Users/asihizkiahu/Library/Developer/Xcode/DerivedData/Vi-chglmmqrkfgvuoflipawibkmabgs/Build/Products/Debug-iphonesimulator/Vi-Dev.app);
capabilities.setCapability("automationName", "XCUITest");
driver = new RemoteWebDriver(new URL(hubUrl), capabilities);
}

Resources