Error in loading Appium XCUITEST driver - ios

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);
}

Related

Cannot find WebViewContext for WkWebView on iOS Simulator with Appium

I currently have no access to the WKWebView via Appium. I start the driver with the following capabilities:
var options = new AppiumOptions();
options.AddAdditionalCapability("automationName", "XCUITest");
options.AddAdditionalCapability("platformName", "iOS");
options.AddAdditionalCapability("platformVersion", "15.5");
options.AddAdditionalCapability("deviceName", "iPad (5th generation)");
options.AddAdditionalCapability("language", "DE");
options.AddAdditionalCapability("app", "/Users/testautomatisierung/Projects/TestAppWebView/TestAppWebView/bin/iPhoneSimulator/Debug/device-builds/ipad6.4-15.5/TestAppWebView.app");
options.AddAdditionalCapability("derivedDataPath", "/Users/testautomatisierung/Library/Developer/Xcode/DerivedData/WebDriverAgent-ciegwgvxzxdrqthilmrmczmqvrgu");
options.AddAdditionalCapability("webviewConnectTimeout", "90000");
options.AddAdditionalCapability("safariLogAllCommunication", "true");
My Appium Server Logs tell me:
[debug] [RemoteDebugger] Found app id key 'PID:6483' for bundle 'com.apple.WebKit.WebContent'
[debug] [RemoteDebugger] Found app id key 'PID:6483' for bundle 'process-com.apple.WebKit.WebContent'
[debug] [RemoteDebugger] Found app id key 'PID:6483' for bundle 'process-SafariViewService'
[debug] [RemoteDebugger] Found app id key 'PID:6483' for bundle 'com.apple.SafariViewService'
[debug] [RemoteDebugger] Found app id key 'PID:6483' for bundle '*'
[debug] [RemoteDebugger] Found app id key 'PID:6483' for bundle 'de.TestAppWebView'
[debug] [RemoteDebugger] Trying out the possible app ids: PID:6483 (try #1 of 20)
[debug] [RemoteDebugger] Attempting app 'PID:6483'
[debug] [RemoteDebugger] Sending '_rpc_forwardGetListing:' message to app 'PID:6483' (id: 42): 'connectToApp'
[debug] [ios-device] Sending message to Web Inspector:
[debug] [ios-device] {
[debug] [ios-device] "__argument": {
[debug] [ios-device] "WIRConnectionIdentifierKey": "470505be-7934-41cd-881e-d2e390be4ffd",
[debug] [ios-device] "WIRApplicationIdentifierKey": "PID:6483"
[debug] [ios-device] },
[debug] [ios-device] "__selector": "_rpc_forwardGetListing:"
[debug] [ios-device] }
[debug] [ios-device] Received message from Web Inspector:
[debug] [ios-device] {
[debug] [ios-device] "__argument": {
[debug] [ios-device] "WIRApplicationIdentifierKey": "PID:6483",
[debug] [ios-device] "WIRListingKey": {}
[debug] [ios-device] },
[debug] [ios-device] "__selector": "_rpc_applicationSentListing:"
[debug] [ios-device] }
[debug] [RemoteDebugger] Received response from send (id: 42): '["PID:6483",{}]'
[debug] [RemoteDebugger] Sending to Web Inspector took 2ms
[debug] [RemoteDebugger] Empty page dictionary received
[debug] [RemoteDebugger] Error checking application: 'Empty page dictionary received'. Retrying connection
[RemoteDebugger] Could not connect to a valid app after 20 tries.
[debug] [XCUITest] No available web pages: Could not connect to a valid app after 20 tries.
[debug] [XCUITest] No web frames found.
[debug] [W3C (4114d2e3)] Responding to client with driver.getContexts() result: ["NATIVE_APP"]
In Safari i enable the development modus and i can find my WebAppView on the simulator. Can someone help me? Thanks

Appium IOSDriver times out, but launches iPhone simulator

My AppiumDriver code is simple enough:
var options = new AppiumOptions();
options.AddAdditionalCapability(MobileCapabilityType.PlatformName, "iOS");
options.AddAdditionalCapability(MobileCapabilityType.DeviceName, "iPhone XR");
options.AddAdditionalCapability(MobileCapabilityType.PlatformVersion, "13.0");
options.AddAdditionalCapability(CapabilityType.BrowserName, "safari");
options.AddAdditionalCapability(MobileCapabilityType.AutomationName, "XCUITest");
var driver2 =
new IOSDriver<AppiumWebElement>(
new Uri($#"http://192.168.0.41:4723/wd/hub"),
options,
new TimeSpan(0, 2, 0));
Appium (running on Mac) launches an iPhone simulator on my Mac machine
appium -a 192.168.0.41 -p 4723
But the IOSDriver constructor never completes, it just times out with exception after 120 seconds (or whatever value I put in there).
This is the output from Appium
[Appium] Welcome to Appium v1.14.2
[Appium] Non-default server args:
[Appium] address: 192.168.0.41
[Appium] Appium REST http interface listener started on 192.168.0.41:4723
[HTTP] --> POST /wd/hub/session
[HTTP] {"desiredCapabilities":{"platformName":"iOS","deviceName":"iPhone XR","platformVersion":"13.0","browserName":"safari","automationName":"XCUITest"},"capabilities":{"firstMatch":[{"platformName":"iOS","browserName":"safari"}]}}
[debug] [W3C] Calling AppiumDriver.createSession() with args: [{"platformName":"iOS","deviceName":"iPhone XR","platformVersion":"13.0","browserName":"safari","automationName":"XCUITest"},null,{"firstMatch":[{"platformName":"iOS","browserName":"safari"}]}]
[debug] [BaseDriver] Event 'newSessionRequested' logged at 1568747029537 (14:03:49 GMT-0500 (Central Daylight Time))
[Appium] Could not parse W3C capabilities: 'deviceName' can't be blank
[Appium] Trying to fix W3C capabilities by merging them with JSONWP caps
[BaseDriver] The capabilities ["deviceName","platformVersion","automationName"] are not standard capabilities and should have an extension prefix
[Appium] Appium v1.14.2 creating new XCUITestDriver (v2.116.3) session
[Appium] Capabilities:
[Appium] deviceName: iPhone XR
[Appium] platformVersion: 13.0
[Appium] automationName: XCUITest
[Appium] platformName: iOS
[Appium] browserName: safari
[debug] [BaseDriver] W3C capabilities {"alwaysMatch":{"appium:dev... and MJSONWP desired capabilities {"platformName":"iOS","devi... were provided
[debug] [BaseDriver] Creating session with W3C capabilities: {"alwaysMatch":{"appium:dev...
[BaseDriver] Session created with session id: 23f10772-5375-4c81-9536-5805132fc717
[debug] [XCUITest] Current user: 'patrick'
[XCUITest] iOS SDK Version set to '13.0'
[XCUITest] Simulator udid not provided
[XCUITest] Using desired caps to create a new simulator
[debug] [simctl] Creating simulator with name 'appiumTest-AA3CE20A-10E7-44EF-A669-2EE6D93D3047-iPhone XR', device type id 'iPhone XR' and runtime id 'com.apple.CoreSimulator.SimRuntime.iOS-13-0'
[iOSSim] Constructing iOS simulator for Xcode version 11.0 with udid '42D158FC-3300-43BF-81A3-5B18B783FEDD'
[XCUITest] Created simulator with udid '42D158FC-3300-43BF-81A3-5B18B783FEDD'.
[XCUITest] Determining device to run tests on: udid: '42D158FC-3300-43BF-81A3-5B18B783FEDD', real device: false
[debug] [BaseDriver] Event 'xcodeDetailsRetrieved' logged at 1568747031680 (14:03:51 GMT-0500 (Central Daylight Time))
[XCUITest] Safari test requested
[debug] [BaseDriver] Event 'appConfigured' logged at 1568747031681 (14:03:51 GMT-0500 (Central Daylight Time))
[XCUITest] Continuing without capturing device logs: iOS Simulator with udid 42D158FC-3300-43BF-81A3-5B18B783FEDD is not running
[XCUITest] Setting up simulator
[debug] [iOSSim] Setting common Simulator preferences to {"RotateWindowWhenSignaledByGuest":true,"ConnectHardwareKeyboard":false}
[debug] [iOSSim] Updated 42D158FC-3300-43BF-81A3-5B18B783FEDD Simulator preferences at '/Users/patrick/Library/Preferences/com.apple.iphonesimulator.plist' with {"DevicePreferences":{"42D158FC-3300-43BF-81A3-5B18B783FEDD":{"ConnectHardwareKeyboard":false}},"RotateWindowWhenSignaledByGuest":true,"ConnectHardwareKeyboard":false}
[iOSSim] Booting Simulator with UDID 42D158FC-3300-43BF-81A3-5B18B783FEDD...
[iOSSim] Simulator with UDID 42D158FC-3300-43BF-81A3-5B18B783FEDD booted in 52 seconds
[debug] [IDB] Connecting idb service to '42D158FC-3300-43BF-81A3-5B18B783FEDD'
[XCUITest] idb will not be used for Simulator interaction. Original error: 'idb' has not been found in PATH. Is it installed? Read https://www.fbidb.io for more details
[debug] [BaseDriver] Event 'simStarted' logged at 1568747084509 (14:04:44 GMT-0500 (Central Daylight Time))
[debug] [XCUITest] Starting log capture for iOS Simulator with udid '42D158FC-3300-43BF-81A3-5B18B783FEDD', using 'xcrun simctl spawn 42D158FC-3300-43BF-81A3-5B18B783FEDD log stream --style compact'
[debug] [BaseDriver] Event 'logCaptureStarted' logged at 1568747085347 (14:04:45 GMT-0500 (Central Daylight Time))
[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] [XCUITest] Parsed BUILD_DIR configuration value: '/Users/patrick/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Build/Products'
[debug] [XCUITest] Got derived data root: '/Users/patrick/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy'
[debug] [XCUITest] Starting WebDriverAgent initialization with the synchronization key '/Users/patrick/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy'
[debug] [WD Proxy] Matched '/status' to command name 'getStatus'
[debug] [WD Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[WD Proxy] Got an unexpected response: {"errno":"ECONNREFUSED","code":"ECONNREFUSED","syscall":"connect","address":"127.0.0.1","port":8100}
[debug] [XCUITest] WDA is not listening at 'http://localhost:8100/'
[debug] [XCUITest] WDA is currently not running. There is nothing to cache
[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 1568747091183 (14:04:51 GMT-0500 (Central Daylight Time))
[XCUITest] Launching WebDriverAgent on the device
[debug] [XCUITest] Carthage found: '/usr/local/bin/carthage'
[debug] [XCUITest] Killing running processes 'xcodebuild.*42D158FC-3300-43BF-81A3-5B18B783FEDD, iproxy 8100, 42D158FC-3300-43BF-81A3-5B18B783FEDD.*XCTRunner' for the device 42D158FC-3300-43BF-81A3-5B18B783FEDD...
[debug] [XCUITest] 'pgrep -ifn xcodebuild.*42D158FC-3300-43BF-81A3-5B18B783FEDD' didn't detect any matching processes. Return code: 1
[debug] [XCUITest] 'pgrep -ifn iproxy 8100' didn't detect any matching processes. Return code: 1
[debug] [XCUITest] 'pgrep -ifn 42D158FC-3300-43BF-81A3-5B18B783FEDD.*XCTRunner' didn't detect any matching processes. Return code: 1
[debug] [XCUITest] Beginning test with command 'xcodebuild build-for-testing test-without-building -project /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -derivedDataPath /Users/patrick/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy -destination id=42D158FC-3300-43BF-81A3-5B18B783FEDD IPHONEOS_DEPLOYMENT_TARGET=13.0 GCC_TREAT_WARNINGS_AS_ERRORS=0 COMPILER_INDEX_STORE_ENABLE=NO' in directory '/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent'
[debug] [XCUITest] Output from xcodebuild will only be logged if any errors are present there. To change this, use 'showXcodeLog' desired capability
[debug] [XCUITest] Waiting up to 60000ms for WebDriverAgent to start
[debug] [WD Proxy] Matched '/status' to command name 'getStatus'
[debug] [WD Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[WD Proxy] Got an unexpected response: {"errno":"ECONNREFUSED","code":"ECONNREFUSED","syscall":"connect","address":"127.0.0.1","port":8100}
[debug] [WD Proxy] Matched '/status' to command name 'getStatus'
[debug] [WD Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[WD Proxy] Got an unexpected response: {"errno":"ECONNREFUSED","code":"ECONNREFUSED","syscall":"connect","address":"127.0.0.1","port":8100}
[debug] [WD Proxy] Matched '/status' to command name 'getStatus'
[debug] [WD Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[debug] [WD Proxy] Got response with status 200: "{\n \"value\" : {\n \"state\" : \"success\",\n \"os\" : {\n \"name\" : \"iOS\",\n \"version\" : \"13.0\",\n \"sdkVersion\" : \"13.0\"\n },\n \"ios\" : {\n \"simulatorVersion\" : \"13.0\",\n \"ip\" : \"192.168.0.41\"\n },\n \"build\" : {\n \"upgradedAt\" : \"1568745012654\",\n \"time\" : \"Sep 17 2019 13:34:34\",\n \"productBundleIdentifier\" : \"com.facebook.WebDriverAgentRunner\"\n }\n },\n \"sessionId\" : \"27F6F5EA-539D-4088-9657-400A8686C4CA\",\n \"status\" : 0\n}"
[debug] [WD Proxy] Determined that the downstream protocol for proxy is MJSONWP
[debug] [XCUITest] WebDriverAgent information:
[debug] [XCUITest] {
[debug] [XCUITest] "state": "success",
[debug] [XCUITest] "os": {
[debug] [XCUITest] "name": "iOS",
[debug] [XCUITest] "version": "13.0",
[debug] [XCUITest] "sdkVersion": "13.0"
[debug] [XCUITest] },
[debug] [XCUITest] "ios": {
[debug] [XCUITest] "simulatorVersion": "13.0",
[debug] [XCUITest] "ip": "192.168.0.41"
[debug] [XCUITest] },
[debug] [XCUITest] "build": {
[debug] [XCUITest] "upgradedAt": "1568745012654",
[debug] [XCUITest] "time": "Sep 17 2019 13:34:34",
[debug] [XCUITest] "productBundleIdentifier": "com.facebook.WebDriverAgentRunner"
[debug] [XCUITest] }
[debug] [XCUITest] }
[debug] [XCUITest] WebDriverAgent successfully started after 15687ms
[debug] [BaseDriver] Event 'wdaSessionAttempted' logged at 1568747107016 (14:05:07 GMT-0500 (Central Daylight 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://localhost:8100/session] with body: {"desiredCapabilities":{"bundleId":"com.apple.mobilesafari","arguments":[],"environment":{},"eventloopIdleDelaySec":0,"shouldWaitForQuiescence":true,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true}}
[debug] [WD Proxy] Got response with status 200: {"value":{"sessionId":"18604E24-D247-4A43-A4A8-5B8F7FCB9D54","capabilities":{"device":"iphone","browserName":"Safari","sdkVersion":"13.0","CFBundleIdentifier":"com.apple.mobilesafari"}},"sessionId":"18604E24-D247-4A43-A4A8-5B8F7FCB9D54","status":0}
[debug] [WD Proxy] Determined that the downstream protocol for proxy is MJSONWP
[debug] [BaseDriver] Event 'wdaSessionStarted' logged at 1568747113342 (14:05:13 GMT-0500 (Central Daylight Time))
[debug] [BaseDriver] Event 'wdaStarted' logged at 1568747113343 (14:05:13 GMT-0500 (Central Daylight Time))
[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 1568747113345 (14:05:13 GMT-0500 (Central Daylight Time))
[debug] [iOS] Selecting by url: true (expected url: 'http://192.168.0.41:4723/welcome')
[RemoteDebugger] Remote Debugger version 4.4.1
[debug] [RemoteDebugger] useNewSafari --> false
[RemoteDebugger] Setting communication protocol: using Target-based communication
[debug] [RemoteDebugger] Connecting to remote debugger through unix domain socket: '/private/tmp/com.apple.launchd.Uf5EaEsH0s/com.apple.webinspectord_sim.socket'
[debug] [RemoteDebugger] Debugger socket connected
[debug] [RemoteDebugger] Sending connection key request
[debug] [RemoteDebugger] Sending '_rpc_reportIdentifier:' message to remote debugger (id: 0)
[HTTP] --> GET /welcome
[HTTP] {}
[debug] [HTTP] Sending welcome response with params: {"message":"Let's browse!"}
[HTTP] <-- GET /welcome 200 83 ms - 124
[HTTP]
[HTTP] <-- GET /favicon.ico 200 3 ms - 1150
[HTTP]
[debug] [RemoteDebugger] Notified of connected drivers: {}.
[debug] [RemoteDebugger] Connected to application
[debug] [RemoteDebugger] Selecting application
[debug] [RemoteDebugger] Current applications available:
[debug] [RemoteDebugger] Application: 'PID:31843'
[debug] [RemoteDebugger] id: "PID:31843"
[debug] [RemoteDebugger] isProxy: false
[debug] [RemoteDebugger] name: "Safari"
[debug] [RemoteDebugger] bundleId: "com.apple.mobilesafari"
[debug] [RemoteDebugger] hostId: undefined
[debug] [RemoteDebugger] isActive: 2
[debug] [RemoteDebugger] isAutomationEnabled: false
[debug] [RemoteDebugger] Found app id key 'PID:31843' for bundle 'com.apple.mobilesafari'
[debug] [RemoteDebugger] Trying out the possible app ids: PID:31843
[debug] [RemoteDebugger] Selecting app PID:31843 (try #1 of 20)
[debug] [RemoteDebugger] Sending '_rpc_forwardGetListing:' message to remote debugger (id: 1)
[debug] [RemoteDebugger] We were notified we might have connected to the wrong app. Using id PID:31846 instead of PID:31843
[debug] [RemoteDebugger] Notified that new application 'PID:31846' has connected
[debug] [RemoteDebugger] Found app id key 'PID:31843' for bundle 'com.apple.mobilesafari'
[debug] [RemoteDebugger] Found separate bundleId 'process-com.apple.WebKit.WebContent' acting as proxy for 'com.apple.mobilesafari', with app id 'PID:31846'
[debug] [RemoteDebugger] Using proxied app id 'PID:31846'
[debug] [RemoteDebugger] Error checking application: 'New application has connected'. Retrying connection
[debug] [RemoteDebugger] Current applications available:
[debug] [RemoteDebugger] Application: 'PID:31843'
[debug] [RemoteDebugger] id: "PID:31843"
[debug] [RemoteDebugger] isProxy: false
[debug] [RemoteDebugger] name: "Safari"
[debug] [RemoteDebugger] bundleId: "com.apple.mobilesafari"
[debug] [RemoteDebugger] hostId: undefined
[debug] [RemoteDebugger] isActive: 2
[debug] [RemoteDebugger] isAutomationEnabled: false
[debug] [RemoteDebugger] Application: 'PID:31846'
[debug] [RemoteDebugger] id: "PID:31846"
[debug] [RemoteDebugger] isProxy: true
[debug] [RemoteDebugger] name: "com.apple.WebKit.WebContent"
[debug] [RemoteDebugger] bundleId: "process-com.apple.WebKit.WebContent"
[debug] [RemoteDebugger] hostId: "PID:31843"
[debug] [RemoteDebugger] isActive: 2
[debug] [RemoteDebugger] isAutomationEnabled: false
[debug] [RemoteDebugger] pageArray: 'Waiting for data'
[debug] [RemoteDebugger] Found app id key 'PID:31843' for bundle 'com.apple.mobilesafari'
[debug] [RemoteDebugger] Found separate bundleId 'process-com.apple.WebKit.WebContent' acting as proxy for 'com.apple.mobilesafari', with app id 'PID:31846'
[debug] [RemoteDebugger] Trying out the possible app ids: PID:31843, PID:31846
[debug] [RemoteDebugger] Selecting app PID:31843 (try #2 of 20)
[debug] [RemoteDebugger] Sending '_rpc_forwardGetListing:' message to remote debugger (id: 2)
[debug] [RemoteDebugger] Received response from socket send: '["PID:31843",{"1":{"WIRTitleKey":"Appium/welcome","WIRTypeKey":"WIRTypeWeb","WIRURLKey":"http://192.168.0.41:4723/welcome","WIRPageIdentifierKey":1}}]'
[debug] [RemoteDebugger] Received response from socket send: '["PID:31843",{"1":{"WIRTitleKey":"Appium/welcome","WIRTypeKey":"WIRTypeWeb","WIRURLKey":"http://192.168.0.41:4723/welcome","WIRPageIdentifierKey":1}}]'
[debug] [RemoteDebugger] Current applications available:
[debug] [RemoteDebugger] Application: 'PID:31843'
[debug] [RemoteDebugger] id: "PID:31843"
[debug] [RemoteDebugger] isProxy: false
[debug] [RemoteDebugger] name: "Safari"
[debug] [RemoteDebugger] bundleId: "com.apple.mobilesafari"
[debug] [RemoteDebugger] hostId: undefined
[debug] [RemoteDebugger] isActive: 2
[debug] [RemoteDebugger] isAutomationEnabled: false
[debug] [RemoteDebugger] pageArray:
[debug] [RemoteDebugger] - id: 1
[debug] [RemoteDebugger] title: "Appium/welcome"
[debug] [RemoteDebugger] url: "http://192.168.0.41:4723/welcome"
[debug] [RemoteDebugger] isKey: false
[debug] [RemoteDebugger] Application: 'PID:31846'
[debug] [RemoteDebugger] id: "PID:31846"
[debug] [RemoteDebugger] isProxy: true
[debug] [RemoteDebugger] name: "com.apple.WebKit.WebContent"
[debug] [RemoteDebugger] bundleId: "process-com.apple.WebKit.WebContent"
[debug] [RemoteDebugger] hostId: "PID:31843"
[debug] [RemoteDebugger] isActive: 2
[debug] [RemoteDebugger] isAutomationEnabled: false
[debug] [RemoteDebugger] pageArray: 'Waiting for data'
[debug] [RemoteDebugger] Page changed: {
[debug] [RemoteDebugger] "1": {
[debug] [RemoteDebugger] "WIRTitleKey": "Appium/welcome",
[debug] [RemoteDebugger] "WIRTypeKey": "WIRTypeWeb",
[debug] [RemoteDebugger] "WIRURLKey": "http://192.168.0.41:4723/welcome",
[debug] [RemoteDebugger] "WIRPageIdentifierKey": 1
[debug] [RemoteDebugger] }
[debug] [RemoteDebugger] }
[debug] [RemoteDebugger] Received page change notice for app 'PID:31843' but listening for 'PID:31846'. Ignoring.
[debug] [RemoteDebugger] Notified that application 'PID:31843' has been updated
[debug] [RemoteDebugger] Received response from socket send: '["PID:31843",{"1":{"WIRTitleKey":"Appium/welcome","WIRTypeKey":"WIRTypeWeb","WIRURLKey":"http://192.168.0.41:4723/welcome","WIRPageIdentifierKey":1}}]'
[debug] [RemoteDebugger] Received page change notice for app 'PID:31843' but the listing has not changed. Ignoring.
[debug] [RemoteDebugger] Received altered app id, updating from 'PID:31846' to 'PID:31843'
[debug] [RemoteDebugger] Waiting for 1 pages to be fulfilled
[debug] [RemoteDebugger] Current applications available:
[debug] [RemoteDebugger] Application: 'PID:31843'
[debug] [RemoteDebugger] id: "PID:31843"
[debug] [RemoteDebugger] isProxy: false
[debug] [RemoteDebugger] name: "Safari"
[debug] [RemoteDebugger] bundleId: "com.apple.mobilesafari"
[debug] [RemoteDebugger] hostId: undefined
[debug] [RemoteDebugger] isActive: 2
[debug] [RemoteDebugger] isAutomationEnabled: false
[debug] [RemoteDebugger] pageArray:
[debug] [RemoteDebugger] - id: 1
[debug] [RemoteDebugger] title: "Appium/welcome"
[debug] [RemoteDebugger] url: "http://192.168.0.41:4723/welcome"
[debug] [RemoteDebugger] isKey: false
[debug] [RemoteDebugger] Application: 'PID:31846'
[debug] [RemoteDebugger] id: "PID:31846"
[debug] [RemoteDebugger] isProxy: true
[debug] [RemoteDebugger] name: "com.apple.WebKit.WebContent"
[debug] [RemoteDebugger] bundleId: "process-com.apple.WebKit.WebContent"
[debug] [RemoteDebugger] hostId: "PID:31843"
[debug] [RemoteDebugger] isActive: 2
[debug] [RemoteDebugger] isAutomationEnabled: false
[debug] [RemoteDebugger] pageArray: []
[debug] [RemoteDebugger] Page changed: {}
[debug] [RemoteDebugger] Received page change notice for app 'PID:31846' but listening for 'PID:31843'. Ignoring.
[debug] [RemoteDebugger] Notified that application 'PID:31846' has been updated
[debug] [RemoteDebugger] Current applications available:
[debug] [RemoteDebugger] Application: 'PID:31843'
[debug] [RemoteDebugger] id: "PID:31843"
[debug] [RemoteDebugger] isProxy: false
[debug] [RemoteDebugger] name: "Safari"
[debug] [RemoteDebugger] bundleId: "com.apple.mobilesafari"
[debug] [RemoteDebugger] hostId: undefined
[debug] [RemoteDebugger] isActive: 2
[debug] [RemoteDebugger] isAutomationEnabled: false
[debug] [RemoteDebugger] pageArray:
[debug] [RemoteDebugger] - id: 1
[debug] [RemoteDebugger] title: "Appium/welcome"
[debug] [RemoteDebugger] url: "http://192.168.0.41:4723/welcome"
[debug] [RemoteDebugger] isKey: false
[debug] [RemoteDebugger] Application: 'PID:31846'
[debug] [RemoteDebugger] id: "PID:31846"
[debug] [RemoteDebugger] isProxy: true
[debug] [RemoteDebugger] name: "com.apple.WebKit.WebContent"
[debug] [RemoteDebugger] bundleId: "process-com.apple.WebKit.WebContent"
[debug] [RemoteDebugger] hostId: "PID:31843"
[debug] [RemoteDebugger] isActive: 2
[debug] [RemoteDebugger] isAutomationEnabled: false
[debug] [RemoteDebugger] pageArray: []
[debug] [RemoteDebugger] Finally selecting app PID:31843: [{"id":1,"title":"Appium/welcome","url":"http://192.168.0.41:4723/welcome","isKey":false}]
[debug] [iOS] Picking webview 'WEBVIEW_31843.1'
[debug] [iOS] Attempting to set context to 'WEBVIEW_31843.1'
[debug] [RemoteDebugger] Selecting page '1' on app 'PID:31843' and forwarding socket setup
[debug] [RemoteDebugger] Sending '_rpc_forwardSocketSetup:' message to remote debugger (id: 3)
[debug] [RemoteDebugger] Sender key set
[debug] [RemoteDebugger] Target created: {"targetId":"page-6","type":"page"}
[debug] [RemoteDebugger] Received page change notice for app 'PID:31843' but the listing has not changed. Ignoring.
[debug] [RemoteDebugger] Notified that application 'PID:31843' has been updated
[debug] [RemoteDebugger] Notified that new application 'PID:31861' has connected
[debug] [RemoteDebugger] Current applications available:
[debug] [RemoteDebugger] Application: 'PID:31843'
[debug] [RemoteDebugger] id: "PID:31843"
[debug] [RemoteDebugger] isProxy: false
[debug] [RemoteDebugger] name: "Safari"
[debug] [RemoteDebugger] bundleId: "com.apple.mobilesafari"
[debug] [RemoteDebugger] hostId: undefined
[debug] [RemoteDebugger] isActive: 2
[debug] [RemoteDebugger] isAutomationEnabled: false
[debug] [RemoteDebugger] pageArray:
[debug] [RemoteDebugger] - id: 1
[debug] [RemoteDebugger] title: "Appium/welcome"
[debug] [RemoteDebugger] url: "http://192.168.0.41:4723/welcome"
[debug] [RemoteDebugger] isKey: false
[debug] [RemoteDebugger] Application: 'PID:31846'
[debug] [RemoteDebugger] id: "PID:31846"
[debug] [RemoteDebugger] isProxy: true
[debug] [RemoteDebugger] name: "com.apple.WebKit.WebContent"
[debug] [RemoteDebugger] bundleId: "process-com.apple.WebKit.WebContent"
[debug] [RemoteDebugger] hostId: "PID:31843"
[debug] [RemoteDebugger] isActive: 2
[debug] [RemoteDebugger] isAutomationEnabled: false
[debug] [RemoteDebugger] pageArray: []
[debug] [RemoteDebugger] Application: 'PID:31861'
[debug] [RemoteDebugger] id: "PID:31861"
[debug] [RemoteDebugger] isProxy: true
[debug] [RemoteDebugger] name: "com.apple.WebKit.WebContent"
[debug] [RemoteDebugger] bundleId: "process-com.apple.WebKit.WebContent"
[debug] [RemoteDebugger] hostId: "PID:31843"
[debug] [RemoteDebugger] isActive: 1
[debug] [RemoteDebugger] isAutomationEnabled: false
[debug] [RemoteDebugger] pageArray: []
[debug] [RemoteDebugger] Page changed: {}
[debug] [RemoteDebugger] Received page change notice for app 'PID:31861' but listening for 'PID:31843'. Ignoring.
[debug] [RemoteDebugger] Notified that application 'PID:31861' has been updated
[debug] [RemoteDebugger] Sending '_rpc_forwardSocketData:' message to remote debugger (id: 4)
[XCUITest] Error: Remote debugger error with code '-32000': Target not found.
[XCUITest] at Object.errorHandler (/usr/local/lib/node_modules/appium/node_modules/appium-remote-debugger/lib/remote-debugger-rpc-client.js:254:18)
[XCUITest] at RpcMessageHandler.handleDataMessage (/usr/local/lib/node_modules/appium/node_modules/appium-remote-debugger/lib/remote-debugger-message-handler.js:194:9)
[XCUITest] at RpcMessageHandler.handleMessage (/usr/local/lib/node_modules/appium/node_modules/appium-remote-debugger/lib/remote-debugger-message-handler.js:77:13)
[XCUITest] at RemoteDebuggerRpcClient.handleMessage [as receive] (/usr/local/lib/node_modules/appium/node_modules/appium-remote-debugger/lib/remote-debugger-rpc-client.js:402:35)
[XCUITest] at Socket.emit (events.js:209:13)
[XCUITest] at addChunk (_stream_readable.js:305:12)
[XCUITest] at readableAddChunk (_stream_readable.js:286:11)
[XCUITest] at Socket.Readable.push (_stream_readable.js:220:10)
[XCUITest] at Pipe.onStreamRead (internal/stream_base_commons.js:182:23)
[debug] [WD Proxy] Matched '/session/23f10772-5375-4c81-9536-5805132fc717' to command name 'deleteSession'
[debug] [WD Proxy] Proxying [DELETE /session/23f10772-5375-4c81-9536-5805132fc717] to [DELETE http://localhost:8100/session/18604E24-D247-4A43-A4A8-5B8F7FCB9D54] with no body
[debug] [RemoteDebugger] Application 'PID:31843' disconnected. Removing from app dictionary.
[debug] [RemoteDebugger] Current app is PID:31843
[debug] [RemoteDebugger] No longer have app id. Attempting to find new one.
[debug] [RemoteDebugger] Application 'PID:31846' disconnected. Removing from app dictionary.
[debug] [RemoteDebugger] Current app is undefined
[debug] [RemoteDebugger] Application 'PID:31861' disconnected. Removing from app dictionary.
[debug] [RemoteDebugger] Current app is undefined
[debug] [WD Proxy] Got response with status 200: "{\n \"value\" : {\n\n },\n \"sessionId\" : \"33A93B5F-A13E-4C1B-B2DE-D243AEC0A4C4\",\n \"status\" : 0\n}"
[debug] [XCUITest] Not clearing log files. Use `clearSystemFiles` capability to turn on.
[debug] [XCUITest] Deleting simulator created for this run (udid: '42D158FC-3300-43BF-81A3-5B18B783FEDD')
[debug] [XCUITest] Killing running processes 'xcodebuild.*42D158FC-3300-43BF-81A3-5B18B783FEDD, 42D158FC-3300-43BF-81A3-5B18B783FEDD.*XCTRunner' for the device 42D158FC-3300-43BF-81A3-5B18B783FEDD...
[XCUITest] xcodebuild exited with code 'null' and signal 'SIGTERM'
[debug] [XCUITest] 'pgrep -ifn xcodebuild.*42D158FC-3300-43BF-81A3-5B18B783FEDD' didn't detect any matching processes. Return code: 1
[debug] [XCUITest] 'pgrep -ifn 42D158FC-3300-43BF-81A3-5B18B783FEDD.*XCTRunner' didn't detect any matching processes. Return code: 1
[debug] [BaseDriver] Event 'newSessionStarted' logged at 1568747136388 (14:05:36 GMT-0500 (Central Daylight Time))
[debug] [W3C] Encountered internal error running command: Error: Remote debugger error with code '-32000': Target not found.
[debug] [W3C] at Object.errorHandler (/usr/local/lib/node_modules/appium/node_modules/appium-remote-debugger/lib/remote-debugger-rpc-client.js:254:18)
[debug] [W3C] at RpcMessageHandler.handleDataMessage (/usr/local/lib/node_modules/appium/node_modules/appium-remote-debugger/lib/remote-debugger-message-handler.js:194:9)
[debug] [W3C] at RpcMessageHandler.handleMessage (/usr/local/lib/node_modules/appium/node_modules/appium-remote-debugger/lib/remote-debugger-message-handler.js:77:13)
[debug] [W3C] at RemoteDebuggerRpcClient.handleMessage [as receive] (/usr/local/lib/node_modules/appium/node_modules/appium-remote-debugger/lib/remote-debugger-rpc-client.js:402:35)
[debug] [W3C] at Socket.emit (events.js:209:13)
[debug] [W3C] at addChunk (_stream_readable.js:305:12)
[debug] [W3C] at readableAddChunk (_stream_readable.js:286:11)
[debug] [W3C] at Socket.Readable.push (_stream_readable.js:220:10)
[debug] [W3C] at Pipe.onStreamRead (internal/stream_base_commons.js:182:23)
[HTTP] <-- POST /wd/hub/session 500 106926 ms - 615
[HTTP]
Encountered internal error running command: Error: Remote debugger error with code '-32000': Target not found.
That means that you did not provide app to start, your driver initialized successfully ( [debug] [XCUITest] WebDriverAgent successfully started after 15687ms ) but since there is no application to start, nothing happens. Add app capability to start application.

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.

Getting error when launching iOS device in appium

I have Xcode 8.2 version. I wrote the code in the eclipse and trying to run. I was able to install the ipa file but while trying to open the app, its not opening. Please find my code below -
package com.sampleiOS.com.sampleiOS;
import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import io.appium.java_client.AppiumDriver;
import io.appium.java_client.MobileElement;
import io.appium.java_client.ios.IOSDriver;
import io.appium.java_client.remote.MobileCapabilityType;
import io.appium.java_client.service.local.AppiumDriverLocalService;
import io.appium.java_client.service.local.AppiumServiceBuilder;
//import org.openqa.selenium.WebDriver;
//import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.testng.annotations.Test;
/**
* Unit test for simple App.
*/
public class AppTest
{
//public WebDriver driver;
public AppiumDriver<MobileElement> driver;
/**
* #return
* #return
* #return the suite of tests being tested
* #throws MalformedURLException
* #throws InterruptedException
*/
#Test
public void Rijo() throws MalformedURLException, InterruptedException
{
AppiumDriverLocalService service = AppiumDriverLocalService
.buildService(new AppiumServiceBuilder()
.usingDriverExecutable(new File("/usr/local/opt/node/bin/node"))
.withAppiumJS(new File(
"/usr/local/lib/node_modules/appium/build/lib/main.js")));
//.withLogFile(new File("AppiumServerLogs/logs.txt")));
service.start();
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "Ipod");
capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, "9.3");
capabilities.setCapability(MobileCapabilityType.UDID, "4319165xxxxx");
capabilities.setCapability("app", "/Users/rijom/Downloads/xx.ipa");
capabilities.setCapability("automationName", "XCUITest");
driver = new IOSDriver<MobileElement>(new URL("http://0.0.0.0:4723/wd/hub"), capabilities);
Thread.sleep(5000);
}
}
Please find appium console log below -
[TestNG] Running:
/private/var/folders/hh/qx4s0ttd3zg3fn0w7g10hgt00000gs/T/testng-eclipse--1535528232/testng-customsuite.xml
[Appium] Welcome to Appium v1.6.0 (REV 0f37e2943bba265b42bb2087ea24b86dcc614c35)
[Appium] Appium REST http interface listener started on 0.0.0.0:4723
[HTTP] --> GET /wd/hub/status {}
[MJSONWP] Calling AppiumDriver.getStatus() with args: []
[MJSONWP] Responding to client with driver.getStatus() result: {"build":{"version":"1.6.0"...
[HTTP] <-- GET /wd/hub/status 200 23 ms - 121
[HTTP] --> POST /wd/hub/session {"desiredCapabilities":{"app":"/Users/rijom/Downloads/RSSFeedReader.ipa","automationName":"XCUITest","udid":"43191654cb4d510f9f3e75a1577fef3bff459859","platformName":"iOS","deviceName":"Ipod","platformVersion":"9.3"}}
[MJSONWP] Calling AppiumDriver.createSession() with args: [{"app":"/Users/rijom/Downl...
[Appium] Creating new XCUITestDriver session
[Appium] Capabilities:
[Appium] app: '/Users/rijom/Downloads/RSSFeedReader.ipa'
[Appium] automationName: 'XCUITest'
[Appium] udid: '43191654cb4d510f9f3e75a1577fef3bff459859'
[Appium] platformName: 'iOS'
[Appium] deviceName: 'Ipod'
[Appium] platformVersion: '9.3'
[debug] [XCUITest] XCUITestDriver version: 2.0.26
[BaseDriver] Session created with session id: ed58e7cb-1b46-42ca-aacf-c5edc9289573
[debug] [XCUITest] Xcode version set to '8.2'
[debug] [XCUITest] iOS SDK Version set to '10.2'
[debug] [XCUITest] Available devices: 43191654cb4d510f9f3e75a1577fef3bff459859
[debug] [XCUITest] Creating iDevice object with udid 43191654cb4d510f9f3e75a1577fef3bff459859
[XCUITest] Determining device to run tests on: udid: '43191654cb4d510f9f3e75a1577fef3bff459859', real device: true
[BaseDriver] Using local app '/Users/rijom/Downloads/RSSFeedReader.ipa'
[debug] [BaseDriver] Copying local zip to tmp dir
[debug] [BaseDriver] Unzipping /var/folders/hh/qx4s0ttd3zg3fn0w7g10hgt00000gs/T/201711-76306-k3wipf.ft3wok1emi/appium-app.zip
[debug] [BaseDriver] Testing zip archive: /var/folders/hh/qx4s0ttd3zg3fn0w7g10hgt00000gs/T/201711-76306-k3wipf.ft3wok1emi/appium-app.zip
[BaseDriver] Unzipped local app to '/var/folders/hh/qx4s0ttd3zg3fn0w7g10hgt00000gs/T/201711-76306-k3wipf.ft3wok1emi/Payload/RSSFeedReader.app'
[debug] [XCUITest] Checking whether app is actually present
[debug] [ios-app-utils] Getting bundle ID from app
[debug] [iOSLog] Attempting iOS device log capture via libimobiledevice idevicesyslog
[debug] [iOSLog] Found idevicesyslog: '/usr/local/bin/idevicesyslog'
[XCUITest] Setting up real device
[debug] [XCUITest] Stdout from app isInstalled check: [....] Waiting for iOS device to be connected
[....] Using iPod Touch 5G 'Ipod' (43191654cb4d510f9f3e75a1577fef3bff459859).
true
[debug] [XCUITest] App is installed.
[debug] [XCUITest] Full reset not requested. No need to install.
[XCUITest] Using default agent: /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj
[XCUITest] Using default bootstrap: /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent
[XCUITest] Launching WebDriverAgent on the device
[debug] [XCUITest] Carthage found: /usr/local/bin/carthage
[debug] [XCUITest] Beginning test with command '/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/bin/run-xcodebuild.sh --project /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj --scheme WebDriverAgentRunner --destination id=43191654cb4d510f9f3e75a1577fef3bff459859' in directory '/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent'
[XCUITest] Waiting for WebDriverAgent to start on device
[debug] [XCUITest] Log file for xcodebuild test: /Users/rijom/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Logs/Test/B8534D7A-50CD-4B8A-8AD6-382B80BC7B84/Session-WebDriverAgentRunner-2017-02-01_154328-QrQMw9.log
[debug] [WebDriverAgent] Device: Feb 1 15:43:53 Ipod XCTRunner[493] <Warning>: Running tests...
[debug] [WebDriverAgent] Device: Feb 1 15:43:55 Ipod XCTRunner[493] <Warning>: Continuing to run tests in the background with task ID 1
[debug] [WebDriverAgent] Device: Feb 1 15:43:56 Ipod XCTRunner[493] <Warning>: Built at Feb 1 2017 15:43:37
[XCUITest] Detected that WebDriverAgent is running at url 'http://192.168.2.112:8100'
[debug] [WebDriverAgent] Device: Feb 1 15:43:57 Ipod XCTRunner[493] <Warning>: ServerURLHere->http://192.168.2.112:8100<-ServerURLHere
[XCUITest] WebDriverAgent started at url 'http://192.168.2.112:8100'
[debug] [XCUITest] Starting iproxy to forward traffic from local port 8100 to device port 8100 over USB
[debug] [WebDriverAgent] Device: Feb 1 15:43:57 Ipod XCTRunner[493] <Warning>: Listening on USB
[debug] [WebDriverAgent] Device: Feb 1 15:43:57 Ipod SpringBoard[48] <Warning>: HW kbd: Failed to set (null) as keyboard focus
[debug] [iProxy] bind(): Address already in use
[debug] [iProxy] Error creating socket: Address already in use
[XCUITest] Error: iproxy exited with code '208'
at SubProcess.<anonymous> (lib/webdriveragent.js:378:25)
at emitTwo (events.js:106:13)
at SubProcess.emit (events.js:191:7)
at ChildProcess.<anonymous> (lib/teen_process.js:191:14)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
Error: iproxy exited with code '208'
at SubProcess.<anonymous> (lib/webdriveragent.js:378:25)
at emitTwo (events.js:106:13)
at SubProcess.emit (events.js:191:7)
at ChildProcess.<anonymous> (lib/teen_process.js:191:14)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
[debug] [XCUITest] Running ios real device reset flow
[debug] [XCUITest] Resetting simulator
[debug] [iOSLog] Stopping iOS log capture
[MJSONWP] Encountered internal error running command: Error: iproxy exited with code '208'
at SubProcess.<anonymous> (lib/webdriveragent.js:378:25)
at emitTwo (events.js:106:13)
at SubProcess.emit (events.js:191:7)
at ChildProcess.<anonymous> (lib/teen_process.js:191:14)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
[HTTP] <-- POST /wd/hub/session 500 71554 ms - 166
FAILED: Rijo
org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: iproxy exited with code '208' (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 71.82 seconds
Build info: version: '2.53.0', revision: '35ae25b1534ae328c771e0856c93e187490ca824', time: '2016-03-15 10:43:46'
System info: host: 'Suvarnaratnas-Mac-mini.local', ip: '192.168.3.135', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.11.5', java.version: '1.8.0_45'
Driver info: io.appium.java_client.ios.IOSDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
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 io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:40)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
at io.appium.java_client.ios.IOSDriver.execute(IOSDriver.java:1)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:249)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:131)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:144)
at io.appium.java_client.DefaultGenericMobileDriver.<init>(DefaultGenericMobileDriver.java:36)
at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:114)
at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:132)
at io.appium.java_client.ios.IOSDriver.<init>(IOSDriver.java:77)
at com.sampleiOS.com.sampleiOS.AppTest.Rijo(AppTest.java:58)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
at org.testng.TestRunner.privateRun(TestRunner.java:767)
at org.testng.TestRunner.run(TestRunner.java:617)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
at org.testng.SuiteRunner.run(SuiteRunner.java:240)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1198)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1123)
at org.testng.TestNG.run(TestNG.java:1031)
at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:132)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:236)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:81)
===============================================
Default test
Tests run: 1, Failures: 1, Skips: 0
===============================================
===============================================
Default suite
Total tests run: 1, Failures: 1, Skips: 0
===============================================
[TestNG] Time taken by org.testng.reporters.EmailableReporter#6a5fc7f7: 85 ms
[TestNG] Time taken by org.testng.reporters.jq.Main#2d209079: 89 ms
[TestNG] Time taken by org.testng.reporters.XMLReporter#2133c8f8: 14 ms
[TestNG] Time taken by [FailedReporter passed=0 failed=0 skipped=0]: 4 ms
[TestNG] Time taken by org.testng.reporters.SuiteHTMLReporter#d041cf: 12 ms
[TestNG] Time taken by org.testng.reporters.JUnitReportReporter#7a79be86: 44 ms
I had updated the WebDriverAgentLib with my app Team and certificates also then its creating an new app as webDriverAgent but not opening my app. Could you help me how to open the app?
If there is a rogue iproxy session you can kill it by executing
ps -ax|grep -i "iproxy"|grep -v grep|awk '{print "kill -9 " $1}'|sh
on the command line.
iProxy is not exited, find the port and kill it.
To find the port:
lsof -i -n -P | grep 8100
To kill:
kill -9 PORT_NUMBER
copy this in terminal
export USE_PORT=8100
For real device, reconnect iOS cable and try running the code.

Appium server throwing Unhandled error: Error: connect ECONNREFUSED

I'm using appium 1.4. Just before client connection to appium server, an appium server socket is created on port 4274. But when client is trying to connect it gets the following exception:
2015-06-03 08:52:32:541 - info: [debug] [BOOTSTRAP] [debug] Socket opened on port 4724
2015-06-03 08:52:32:554 - info: [debug] [BOOTSTRAP] [debug] Appium Socket Server Ready
2015-06-03 08:52:32:555 - info: [debug] [BOOTSTRAP] [debug] Loading json...
2015-06-03 08:52:32:555 - info: [debug] [BOOTSTRAP] [debug] Registered crash watchers.
2015-06-03 08:52:33:552 - error: Unhandled error: Error: connect ECONNREFUSED
at errnoException (net.js:904:11)
at Object.afterConnect [as oncomplete] (net.js:895:19) context: [POST /wd/hub/session {"desiredCapabilities":{"automationName":"Appium","platformVersion":"Nokia X software platform 1.1","deviceName":"Nokia XL Dual SIM","platformName":"Android","browserName":"Browser"}}]
But, there is no server socket created on port 4274 on host where appium is running.
Could someone suggest me what went wrong and how to resolve this issue ?

Resources