Appium IOSDriver times out, but launches iPhone simulator - appium
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.
Related
Getting error as xcodebuild failed with code 65 Event 'wdaStartFailed'
Hi getting below error while running appium automation sript for ios device using xcode 14.I tried all th possible solutions but no luck so far. As per below link there is a changes in xcode 14 which support only appium 2,but before trying appium 2 i wanted to confirm once whether this is the actual root cause or there is any other config issue https://forum.katalon.com/t/failed-to-build-webdriveragent-to-deployed-on-ios-16/78524 Below is the complete appium log [info] [35m[Appium][39m Appium v1.22.0 creating new XCUITestDriver (v3.53.1) session [info] [35m[Appium][39m Applying relaxed security to 'XCUITestDriver' as per server command line argument. All insecure features will be enabled unless explicitly disabled by --deny-insecure [debug] [35m[BaseDriver][39m Creating session with W3C capabilities: { [debug] [35m[BaseDriver][39m "alwaysMatch": { [debug] [35m[BaseDriver][39m "platformName": "ios", [debug] [35m[BaseDriver][39m "appium:VERSION": "15.6.1", [debug] [35m[BaseDriver][39m "appium:automationName": "XCUITest", [debug] [35m[BaseDriver][39m "appium:bundleId": "com.mobisy.bizom", [debug] [35m[BaseDriver][39m "appium:deviceName": "Bizom Iphone", [debug] [35m[BaseDriver][39m "appium:udid": "00008110-001475EE0C80401E", [debug] [35m[BaseDriver][39m "appium:xcodeOrgId": "CM3KB1234", [debug] [35m[BaseDriver][39m "appium:xcodeSigningId": "iPhone Developer" [debug] [35m[BaseDriver][39m }, [debug] [35m[BaseDriver][39m "firstMatch": [ [debug] [35m[BaseDriver][39m {} [debug] [35m[BaseDriver][39m ] [debug] [35m[BaseDriver][39m } [debug] [35m[WD Proxy][39m Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body [debug] [35m[iProxy#00008110:8100][39m Connection was refused to port 8100 [info] [35m[WD Proxy][39m socket hang up[debug] [35m[WD Proxy][39m Matched '/status' to command name 'getStatus' [debug] [35m[WD Proxy][39m Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body [debug] [35m[iProxy#00008110:8100][39m Connection was refused to port 8100 [info] [35m[WD Proxy][39m socket hang up[error] [35m[WebDriverAgent][39m xcodebuild exited with code '65' and signal 'null' [info] [35m[WebDriverAgent][39m Launching WebDriverAgent on the device [info] [35m[WebDriverAgent][39m WebDriverAgent does not need a cleanup. The sources are up to date (1644399105000 >= 1632535255000) [debug] [35m[WebDriverAgent][39m Killing running processes 'xcodebuild.*00008110-001475EE0C80401E' for the device 00008110-001475EE0C80401E...[debug] [35m[WebDriverAgent][39m 'pgrep -if xcodebuild.*00008110-001475EE0C80401E' didn't detect any matching processes. Return code: 1 [debug] [35m[WebDriverAgent][39m Using Xcode configuration file: '/var/folders/nt/rb3yh81n7m543x9rl4996v7c0000gp/T/202303-842-1lzs80g.e5g4/appium-temp.xcconfig' [debug] [35m[WebDriverAgent][39m Beginning test with command 'xcodebuild build-for-testing test-without-building -project /Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -derivedDataPath /Users/divya.p/Library/Developer/Xcode/DerivedData/WebDriverAgent-aghlrsejdreqngftgvcqwnjgrbou -destination id=00008110-001475EE0C80401E IPHONEOS_DEPLOYMENT_TARGET=15.6 -xcconfig /var/folders/nt/rb3yh81n7m543x9rl4996v7c0000gp/T/202303-842-1lzs80g.e5g4/appium-temp.xcconfig GCC_TREAT_WARNINGS_AS_ERRORS=0 COMPILER_INDEX_STORE_ENABLE=NO' in directory '/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-webdriveragent' [debug] [35m[WebDriverAgent][39m Output from xcodebuild will only be logged if any errors are present there. To change this, use 'showXcodeLog' desired capability[debug] [35m[WD Proxy][39m Matched '/status' to command name 'getStatus' [info] [35m[WD Proxy][39m socket hang up[debug] [35m[WD Proxy][39m Matched '/status' to command name 'getStatus' [debug] [35m[WD Proxy][39m Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body[debug] [35m[WD Proxy][39m Matched '/status' to command name 'getStatus' [debug] [35m[WD Proxy][39m Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body [debug] [35m[iProxy#00008110:8100][39m Connection was refused to port 8100 [info] [35m[WD Proxy][39m socket hang up [error] [35m[WebDriverAgent][39m xcodebuild exited with code '65' and signal 'null' [debug] [35m[BaseDriver][39m Event 'wdaStartFailed' logged at 1672738945363 (15:12:25 GMT+0530 (India Standard Time)) [debug] [35m[XCUITest][39m Unable to launch WebDriverAgent because of xcodebuild failure: xcodebuild failed with code 65 [debug] [35m[XCUITest][39m xcodebuild error message: [debug] [35m[XCUITest][39m . Make sure you follow the tutorial at https://github.com/appium/appium-xcuitest-driver/blob/master/docs/real-device-config.md. Try to remove the WebDriverAgentRunner application from the device if it is installed and reboot the device. [warn] [35m[XCUITest][39m Quitting and uninstalling WebDriverAgent [info] [35m[WebDriverAgent][39m Shutting down sub-processes[debug] [35m[WebDriverAgent][39m Uninstalling WDAs: 'com.mobisy.bizom.xctrunner'[error] [35m[XCUITest][39m {} [info] [35m[DevCon Factory][39m Releasing connections for 00008110-001475EE0C80401E device on any port number [info] [35m[DevCon Factory][39m Found cached connections to release: ["00008110-001475EE0C80401E:8100"] [info] [35m[DevCon Factory][39m Releasing the listener for '00008110-001475EE0C80401E:8100' [debug] [35m[iProxy#00008110:8100][39m Closing the connection [debug] [35m[DevCon Factory][39m Cached connections count: 0 [debug] [35m[XCUITest][39m Not clearing log files. Use `clearSystemFiles` capability to turn on. [info] [35m[iProxy#00008110:8100][39m The connection has been closed
An unknown server-side error occurred while processing the command. Original error: Could not navigate to webview; there are none
Desired capabilities "appium:platformName": "iOS", "appium:platformVersion": "15.0", "appium:deviceName": "iPhone 13 pro Max", "appium:automationName": "XCUITest", "udid": "0B2392E0-F3A7-4860-8E01-98C2B43EE6C9", "autoWebview": "true" ENVIRONMENT: 1)Appium Server GUI : 1.22.0 2)Xcode - 13.0 3)appium inspector - 2022.2.1 4)Java - 18.0.2.1 5)Selenium - 3.11.0 6)java-client - 6.0.0-BETA5 7)Eclipse-Version: 2022-06 (4.24.0) 8)os.name: 'Mac OS X 9)os.version: '12.5.1' NOTE: It works fine on browserstack but the issue is observed when i try to switch to webview on local. Is there any other capabilities that I need to add to switch the context from native to webview Appium logs [RemoteDebugger] Checking for bundle identifiers: com.apple.WebKit.WebContent, process-com.apple.WebKit.WebContent, process-SafariViewService, com.apple.SafariViewService, *, xxxxx [RemoteDebugger] Found app id key 'PID:41591' for bundle 'com.apple.WebKit.WebContent' [RemoteDebugger] Found app id key 'PID:41591' for bundle 'process-com.apple.WebKit.WebContent' [RemoteDebugger] Found app id key 'PID:41591' for bundle 'process-SafariViewService' [RemoteDebugger] Found app id key 'PID:41591' for bundle 'com.apple.SafariViewService' [RemoteDebugger] Found app id key 'PID:41591' for bundle '*' [RemoteDebugger] Found app id key 'PID:41591' for bundle 'xxxxxxx' [RemoteDebugger] Trying out the possible app ids: PID:41591 (try #1 of 20) [RemoteDebugger] Attempting app 'PID:41591' [RemoteDebugger] Sending '_rpc_forwardGetListing:' message to app 'PID:41591' (id: 376): 'connectToApp' [RemoteDebugger] Received response from send (id: 376): '["PID:41591",{}]' [RemoteDebugger] Sending to Web Inspector took 1ms [RemoteDebugger] Empty page dictionary received [RemoteDebugger] Error checking application: 'Empty page dictionary received'. Retrying connection [RemoteDebugger] Current applications available: [RemoteDebugger] Application: "PID:41591" [RemoteDebugger] id: "PID:41591" [RemoteDebugger] isProxy: false [RemoteDebugger] name: "com.apple.WebKit.WebContent" [RemoteDebugger] bundleId: "process-com.apple.WebKit.WebContent" [RemoteDebugger] hostId: undefined [RemoteDebugger] isActive: true [RemoteDebugger] isAutomationEnabled: "Unknown" [RemoteDebugger] Application: "PID:41592" [RemoteDebugger] id: "PID:41592" [RemoteDebugger] isProxy: false [RemoteDebugger] name: "com.apple.WebKit.Networking" [RemoteDebugger] bundleId: "process-com.apple.WebKit.Networking" [RemoteDebugger] hostId: undefined [RemoteDebugger] isActive: true [RemoteDebugger] isAutomationEnabled: "Unknown" [RemoteDebugger] Application: "PID:41589" [RemoteDebugger] id: "PID:41589" [RemoteDebugger] isProxy: false [RemoteDebugger] name: "xxxxxx" [RemoteDebugger] bundleId: "process-Zetadocs.Approval.Mobile.iOS" [RemoteDebugger] hostId: undefined [RemoteDebugger] isActive: true [RemoteDebugger] isAutomationEnabled: "Unknown" [RemoteDebugger] Checking for bundle identifiers: com.apple.WebKit.WebContent, process-com.apple.WebKit.WebContent, process-SafariViewService, com.apple.SafariViewService, *, xxxxxxx [RemoteDebugger] Found app id key 'PID:41591' for bundle 'com.apple.WebKit.WebContent' [RemoteDebugger] Found app id key 'PID:41591' for bundle 'process-com.apple.WebKit.WebContent' [RemoteDebugger] Found app id key 'PID:41591' for bundle 'process-SafariViewService' [RemoteDebugger] Found app id key 'PID:41591' for bundle 'com.apple.SafariViewService' [RemoteDebugger] Found app id key 'PID:41591' for bundle '*' [RemoteDebugger] Found app id key 'PID:41591' for bundle 'xxxxxx' [RemoteDebugger] Trying out the possible app ids: PID:41591 (try #1 of 20) [RemoteDebugger] Attempting app 'PID:41591' [RemoteDebugger] Sending '_rpc_forwardGetListing:' message to app 'PID:41591' (id: 378): 'connectToApp' [RemoteDebugger] Received response from send (id: 378): '["PID:41591",{}]' [RemoteDebugger] Sending to Web Inspector took 1ms [RemoteDebugger] Empty page dictionary received [RemoteDebugger] Error checking application: 'Empty page dictionary received'. Retrying connection [RemoteDebugger] Could not connect to a valid app after 20 tries. [XCUITest] No available web pages: Could not connect to a valid app after 20 tries. [XCUITest] No web frames found. [XCUITest] {} [WD Proxy] Matched '/session/35db46e3-9aab-48f8-afe5-d6e11abe8ff1' to command name 'deleteSession' [WD Proxy] Proxying [DELETE /session/35db46e3-9aab-48f8-afe5-d6e11abe8ff1] to [DELETE http://127.0.0.1:8100/session/2DAE2402-0733-43DC-A98E-1CDD488A2CA4] with no body [WD Proxy] Got response with status 200: {"value":null,"sessionId":null} [DevCon Factory] Releasing connections for 0B2392E0-F3A7-4860-8E01-98C2B43EE6C9 device on any port number [DevCon Factory] Found cached connections to release: ["0B2392E0-F3A7-4860-8E01-98C2B43EE6C9:8100"] [DevCon Factory] Cached connections count: 0 [XCUITest] Not clearing log files. Use `clearSystemFiles` capability to turn on. [XCUITest] Found a remote debugger session. Removing... [RemoteDebugger] Disconnecting from remote debugger [RemoteDebugger] Cleaning up listeners [IOSSimulatorLog] Stopping iOS log capture [BaseDriver] Event 'newSessionStarted' logged at 1664949451836 (11:27:31 GMT+0530 (India Standard Time)) [W3C] Encountered internal error running command: Error: Could not navigate to webview; there are none! [W3C] at spinHandles (/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/lib/commands/context.js:161:13) [W3C] at spinHandles (/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/lib/commands/context.js:168:14) [W3C] at spinHandles (/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/lib/commands/context.js:168:14) [W3C] at spinHandles (/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/lib/commands/context.js:168:14) [W3C] at spinHandles (/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/lib/commands/context.js:168:14) [W3C] at spinHandles (/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/lib/commands/context.js:168:14) [W3C] at spinHandles (/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/lib/commands/context.js:168:14) [W3C] at spinHandles (/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/lib/commands/context.js:168:14) [W3C] at spinHandles (/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/lib/commands/context.js:168:14) [W3C] at XCUITestDriver.navToViewWithTitle (/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/lib/commands/context.js:186:3) [W3C] at XCUITestDriver.navToInitialWebview (/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/lib/commands/context.js:222:5) [W3C] at XCUITestDriver.start (/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/lib/driver.js:528:7) [W3C] at XCUITestDriver.createSession (/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/lib/driver.js:262:7) [W3C] at AppiumDriver.createSession (/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/lib/appium.js:387:35) [HTTP] <-- POST /wd/hub/session 500 95464 ms - 677 [HTTP] Can anyone please help on this issue?
I had the same issue, I solved it by activating Safari Web-Inspector. Settings -> Safari -> Advanced -> Web Inspector Hope it works for you :)
I had the same issue, I solved it by activating Safari Web-Inspector. Settings -> Safari -> Advanced -> Web Inspector Hope it works for you :)
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 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); }