facebookarchive / WebDriverAgent

A WebDriver server for iOS that runs inside the Simulator.
Other
4.15k stars 1.35k forks source link

Original error: Error Domain=com.facebook.WebDriverAgent Code=1 #1025

Open EchoWang1024 opened 5 years ago

EchoWang1024 commented 5 years ago

The problem

hi, An error occurred when I was using appium for element operation.

Environment

Appium logs

[Appium] Welcome to Appium v1.9.1 [Appium] Appium REST http interface listener started on 0.0.0.0:4723 [HTTP] --> POST /wd/hub/session [HTTP] {"capabilities":{"firstMatch":[{"appium:app":"cn.xiaochuankeji.tieba-ih","platformName":"iOS","appium:platformVersion":"11.4.1","appium:deviceName":"testphone","appium:automationName":"XCUITest","appium:udid":"48b92f5466bb72c7b00462eea82fb2b7de976a1d","appium:newCommandTimeout":300,"appium:xcodeOrgId":"x","appium:xcodeSigningId":"iPhone Developer"}]},"desiredCapabilities":{"app":"cn.xiaochuankeji.tieba-ih","platformName":"iOS","platformVersion":"11.4.1","deviceName":"testphone","automationName":"XCUITest","udid":"48b92f5466bb72c7b00462eea82fb2b7de976a1d","newCommandTimeout":300,"xcodeOrgId":"x","xcodeSigningId":"iPhone Developer"}} [W3C] Calling AppiumDriver.createSession() with args: [{"app":"cn.xiaochuankeji.tieba-ih","platformName":"iOS","platformVersion":"11.4.1","deviceName":"testphone","automationName":"XCUITest","udid":"48b92f5466bb72c7b00462eea82fb2b7de976a1d","newCommandTimeout":300,"xcodeOrgId":"x","xcodeSigningId":"iPhone Developer"},null,{"firstMatch":[{"appium:app":"cn.xiaochuankeji.tieba-ih","platformName":"iOS","appium:platformVersion":"11.4.1","appium:deviceName":"testphone","appium:automationName":"XCUITest","appium:udid":"48b92f5466bb72c7b00462eea82fb2b7de976a1d","appium:newCommandTimeout":300,"appium:xcodeOrgId":"x","appium:xcodeSigningId":"iPhone Developer"}]}] [BaseDriver] Event 'newSessionRequested' logged at 1541403734718 (15:42:14 GMT+0800 (CST)) [Appium] Creating new XCUITestDriver (v2.94.2) session [Appium] Capabilities: [Appium] platformName: iOS [Appium] app: cn.xiaochuankeji.tieba-ih [Appium] platformVersion: 11.4.1 [Appium] deviceName: testphone [Appium] automationName: XCUITest [Appium] udid: 48b92f5466bb72c7b00462eea82fb2b7de976a1d [Appium] newCommandTimeout: 300 [Appium] xcodeOrgId: x [Appium] xcodeSigningId: iPhone Developer [BaseDriver] W3C capabilities {"alwaysMatch":{"platformNa... and MJSONWP desired capabilities {"app":"cn.xiaochuankeji.ti... were provided [BaseDriver] Creating session with W3C capabilities: {"alwaysMatch":{"platformNa... [BaseDriver] Session created with session id: 9ae4bf70-3774-435b-9db5-88cb86bd96cc [XCUITest] Current user: 'wangzhen' [XCUITest] Xcode version set to '10.0' [XCUITest] iOS SDK Version set to '12.0' [BaseDriver] Event 'xcodeDetailsRetrieved' logged at 1541403735061 (15:42:15 GMT+0800 (CST)) [XCUITest] Available devices: 48b92f5466bb72c7b00462eea82fb2b7de976a1d [XCUITest] Creating iDevice object with udid '48b92f5466bb72c7b00462eea82fb2b7de976a1d' [XCUITest] Determining device to run tests on: udid: '48b92f5466bb72c7b00462eea82fb2b7de976a1d', real device: true [XCUITest] App is an iOS bundle, will attempt to run as pre-existing [BaseDriver] Event 'appConfigured' logged at 1541403735875 (15:42:15 GMT+0800 (CST)) [BaseDriver] Event 'resetStarted' logged at 1541403735875 (15:42:15 GMT+0800 (CST)) [XCUITest] Reset: running ios real device reset flow [BaseDriver] Event 'resetComplete' logged at 1541403735875 (15:42:15 GMT+0800 (CST)) [iOSLog] Attempting iOS device log capture via libimobiledevice idevicesyslog [iOSLog] Starting iOS device log capture with: 'idevicesyslog' [XCUITest] Crash reports root '/Users/wangzhen/Library/Logs/CrashReporter/MobileDevice/iPhone6splus黑' does not exist. Got nothing to gather. [BaseDriver] Event 'logCaptureStarted' logged at 1541403736031 (15:42:16 GMT+0800 (CST)) [XCUITest] Setting up real device [XCUITest] Using WDA path: '/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent' [XCUITest] Using WDA agent: '/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj' [XCUITest] No obsolete cached processes from previous WDA sessions listening on port 8100 have been found [JSONWP Proxy] Matched '/status' to command name 'getStatus' [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body [XCUITest] WDA is not listening at 'http://localhost:8100/' [XCUITest] WDA is currently not running. There is nothing to cache [XCUITest] Trying to start WebDriverAgent 1 times with 10000ms interval [BaseDriver] Event 'wdaStartAttempted' logged at 1541403736522 (15:42:16 GMT+0800 (CST)) [XCUITest] Launching WebDriverAgent on the device [XCUITest] Carthage found: '/usr/local/bin/carthage' [XCUITest] Killing running processes 'xcodebuild.48b92f5466bb72c7b00462eea82fb2b7de976a1d, iproxy 8100' for the device 48b92f5466bb72c7b00462eea82fb2b7de976a1d... [XCUITest] 'pgrep -nif xcodebuild.48b92f5466bb72c7b00462eea82fb2b7de976a1d' didn't detect any matching processes. Return code: 1 [XCUITest] 'pgrep -nif iproxy 8100' didn't detect any matching processes. Return code: 1 [XCUITest] Starting iproxy to forward traffic from local port 8100 to device port 8100 over USB for the device 48b92f5466bb72c7b00462eea82fb2b7de976a1d [XCUITest] Generating xcode config file for orgId 'x' and signingId 'iPhone Developer' [XCUITest] Writing xcode config file to /var/folders/lq/tfk59xld7jlbt1smx288s5gc0000gn/T/2018105-4535-1m17obz.8i37/appium-temp.xcconfig [XCUITest] Using Xcode configuration file: '/var/folders/lq/tfk59xld7jlbt1smx288s5gc0000gn/T/2018105-4535-1m17obz.8i37/appium-temp.xcconfig' [XCUITest] Beginning test with command 'xcodebuild build-for-testing test-without-building -project /Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination id=48b92f5466bb72c7b00462eea82fb2b7de976a1d IPHONEOS_DEPLOYMENT_TARGET=11.4 -xcconfig /var/folders/lq/tfk59xld7jlbt1smx288s5gc0000gn/T/2018105-4535-1m17obz.8i37/appium-temp.xcconfig' in directory '/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent' [XCUITest] Output from xcodebuild will not be logged. To change this, use 'showXcodeLog' desired capability [XCUITest] Waiting up to 60000ms for WebDriverAgent to start [JSONWP Proxy] Matched '/status' to command name 'getStatus' [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body [JSONWP Proxy] Got response with status 200: "{\n \"value\" : {\n \"state\" : \"success\",\n \"os\" : {\n \"name\" : \"iOS\",\n \"version\" : \"11.4.1\",\n \"sdkVersion\" : \"12.0\"\n },\n \"ios\" : {\n \"simulatorVersion\" : \"11.4.1\",\n \"ip\" : \"192.168.8.208\"\n },\n \"build\" : {\n \"time\" : \"Nov 5 2018 15:12:26\",\n \"productBundleIdentifier\" : \"com.facebook.WebDriverAgentRunner\"\n }\n },\n \"sessionId\" : \"B3CC3F40-E23B-4A6A-8672-2A5FD542F7C7\",\n \"status\" : 0\n}" [XCUITest] WebDriverAgent information: [XCUITest] { [XCUITest] "state": "success", [XCUITest] "os": { [XCUITest] "name": "iOS", [XCUITest] "version": "11.4.1", [XCUITest] "sdkVersion": "12.0" [XCUITest] }, [XCUITest] "ios": { [XCUITest] "simulatorVersion": "11.4.1", [XCUITest] "ip": "192.168.8.208" [XCUITest] }, [XCUITest] "build": { [XCUITest] "time": "Nov 5 2018 15:12:26", [XCUITest] "productBundleIdentifier": "com.facebook.WebDriverAgentRunner" [XCUITest] } [XCUITest] } [XCUITest] WebDriverAgent successfully started after 1898ms [BaseDriver] Event 'wdaSessionAttempted' logged at 1541403743537 (15:42:23 GMT+0800 (CST)) [XCUITest] Sending createSession command to WDA [JSONWP Proxy] Matched '/session' to command name 'createSession' [JSONWP Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"desiredCapabilities":{"bundleId":"cn.xiaochuankeji.tieba-ih","arguments":[],"environment":{},"shouldWaitForQuiescence":true,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true}} [XCUITest] xcodebuild exited with code 'null' and signal 'SIGABRT' [JSONWP Proxy] Got response with status 200: {"value":{"sessionId":"BCD268D5-5910-46A8-9824-769D1274BB56","capabilities":{"device":"iphone","browserName":"最右-内测","sdkVersion":"11.4.1","CFBundleIdentifier":"cn.xiaochuankeji.tieba-ih"}},"sessionId":"BCD268D5-5910-46A8-9824-769D1274BB56","status":0} [BaseDriver] Event 'wdaSessionStarted' logged at 1541403749254 (15:42:29 GMT+0800 (CST)) [BaseDriver] Event 'wdaStarted' logged at 1541403749254 (15:42:29 GMT+0800 (CST)) [XCUITest] Skipping setting of the initial display orientation. Set the "orientation" capability to either "LANDSCAPE" or "PORTRAIT", if this is an undesired behavior. [BaseDriver] Event 'orientationSet' logged at 1541403749255 (15:42:29 GMT+0800 (CST)) [Appium] New XCUITestDriver session created successfully, session 9ae4bf70-3774-435b-9db5-88cb86bd96cc added to master session list [BaseDriver] Event 'newSessionStarted' logged at 1541403749256 (15:42:29 GMT+0800 (CST)) [W3C] Cached the protocol value 'W3C' for the new session 9ae4bf70-3774-435b-9db5-88cb86bd96cc [W3C] Responding to client with driver.createSession() result: {"capabilities":{"webStorageEnabled":false,"locationContextEnabled":false,"browserName":"","platform":"MAC","javascriptEnabled":true,"databaseEnabled":false,"takesScreenshot":true,"networkConnectionEnabled":false,"platformName":"iOS","app":"cn.xiaochuankeji.tieba-ih","platformVersion":"11.4.1","deviceName":"testphone","automationName":"XCUITest","udid":"48b92f5466bb72c7b00462eea82fb2b7de976a1d","newCommandTimeout":300,"xcodeOrgId":"x","xcodeSigningId":"iPhone Developer"}} [HTTP] <-- POST /wd/hub/session 200 14539 ms - 565 [HTTP] [HTTP] --> POST /wd/hub/session/9ae4bf70-3774-435b-9db5-88cb86bd96cc/element [HTTP] {"using":"accessibility id","value":"(profileButton)","sessionId":"9ae4bf70-3774-435b-9db5-88cb86bd96cc"} [W3C] Calling AppiumDriver.findElement() with args: ["accessibility id","(profileButton)","9ae4bf70-3774-435b-9db5-88cb86bd96cc"] [XCUITest] Executing command 'findElement' [BaseDriver] Valid locator strategies for this request: xpath, id, name, class name, -ios predicate string, -ios class chain, accessibility id [BaseDriver] Waiting up to 0 ms for condition [JSONWP Proxy] Matched '/element' to command name 'findElement' [JSONWP Proxy] Proxying [POST /element] to [POST http://localhost:8100/session/BCD268D5-5910-46A8-9824-769D1274BB56/element] with body: {"using":"accessibility id","value":"(profileButton)"} [JSONWP Proxy] Got response with status 200: {"value":{"ELEMENT":"23000000-0000-0000-2A04-000000000000"},"sessionId":"BCD268D5-5910-46A8-9824-769D1274BB56","status":0} [W3C] Responding to client with driver.findElement() result: {"element-6066-11e4-a52e-4f735466cecf":"23000000-0000-0000-2A04-000000000000"} [HTTP] <-- POST /wd/hub/session/9ae4bf70-3774-435b-9db5-88cb86bd96cc/element 200 4669 ms - 88 [HTTP] [HTTP] --> POST /wd/hub/session/9ae4bf70-3774-435b-9db5-88cb86bd96cc/element/23000000-0000-0000-2A04-000000000000/click [HTTP] {"id":"23000000-0000-0000-2A04-000000000000","sessionId":"9ae4bf70-3774-435b-9db5-88cb86bd96cc"} [W3C] Driver proxy active, passing request on via HTTP proxy [XCUITest] Executing command 'proxyReqRes' [JSONWP Proxy] Matched '/wd/hub/session/9ae4bf70-3774-435b-9db5-88cb86bd96cc/element/23000000-0000-0000-2A04-000000000000/click' to command name 'click' [JSONWP Proxy] Proxying [POST /wd/hub/session/9ae4bf70-3774-435b-9db5-88cb86bd96cc/element/23000000-0000-0000-2A04-000000000000/click] to [POST http://localhost:8100/session/BCD268D5-5910-46A8-9824-769D1274BB56/element/23000000-0000-0000-2A04-000000000000/click] with body: {"id":"23000000-0000-0000-2A04-000000000000","sessionId":"9ae4bf70-3774-435b-9db5-88cb86bd96cc"} [JSONWP Proxy] Got response with status 200: {"status":0,"id":"23000000-0000-0000-2A04-000000000000","value":"","sessionId":"BCD268D5-5910-46A8-9824-769D1274BB56"} [JSONWP Proxy] Replacing sessionId BCD268D5-5910-46A8-9824-769D1274BB56 with 9ae4bf70-3774-435b-9db5-88cb86bd96cc [HTTP] <-- POST /wd/hub/session/9ae4bf70-3774-435b-9db5-88cb86bd96cc/element/23000000-0000-0000-2A04-000000000000/click 200 6657 ms - 118 [HTTP] [HTTP] --> POST /wd/hub/session/9ae4bf70-3774-435b-9db5-88cb86bd96cc/element [HTTP] {"using":"xpath","value":"//[@label='机器人9527']","sessionId":"9ae4bf70-3774-435b-9db5-88cb86bd96cc"} [W3C] Calling AppiumDriver.findElement() with args: ["xpath","//[@label='机器人9527']","9ae4bf70-3774-435b-9db5-88cb86bd96cc"] [XCUITest] Executing command 'findElement' [BaseDriver] Valid locator strategies for this request: xpath, id, name, class name, -ios predicate string, -ios class chain, accessibility id [BaseDriver] Waiting up to 0 ms for condition [JSONWP Proxy] Matched '/element' to command name 'findElement' [JSONWP Proxy] Proxying [POST /element] to [POST http://localhost:8100/session/BCD268D5-5910-46A8-9824-769D1274BB56/element] with body: {"using":"xpath","value":"//*[@label='机器人9527']"} [JSONWP Proxy] Got response with status 200: {"value":{"ELEMENT":"2B080000-0000-0000-2A04-000000000000"},"sessionId":"BCD268D5-5910-46A8-9824-769D1274BB56","status":0} [W3C] Responding to client with driver.findElement() result: {"element-6066-11e4-a52e-4f735466cecf":"2B080000-0000-0000-2A04-000000000000"} [HTTP] <-- POST /wd/hub/session/9ae4bf70-3774-435b-9db5-88cb86bd96cc/element 200 8603 ms - 88 [HTTP] [HTTP] --> DELETE /wd/hub/session/9ae4bf70-3774-435b-9db5-88cb86bd96cc [HTTP] {} [W3C] Calling AppiumDriver.deleteSession() with args: ["9ae4bf70-3774-435b-9db5-88cb86bd96cc"] [BaseDriver] Event 'quitSessionRequested' logged at 1541403772212 (15:42:52 GMT+0800 (CST)) [Appium] Removing session 9ae4bf70-3774-435b-9db5-88cb86bd96cc from our master session list [JSONWP Proxy] Matched '/session/9ae4bf70-3774-435b-9db5-88cb86bd96cc' to command name 'deleteSession' [JSONWP Proxy] Proxying [DELETE /session/9ae4bf70-3774-435b-9db5-88cb86bd96cc] to [DELETE http://localhost:8100/session/BCD268D5-5910-46A8-9824-769D1274BB56] with no body [JSONWP Proxy] Got response with status 200: "{\n \"value\" : {\n\n },\n \"sessionId\" : \"9C739371-B931-40B4-A9E6-CDA10E9B7CCE\",\n \"status\" : 0\n}" [XCUITest] Not clearing log files. Use clearSystemFiles capability to turn on. [BaseDriver] Event 'quitSessionFinished' logged at 1541403773252 (15:42:53 GMT+0800 (CST)) [W3C] Received response: null [W3C] But deleting session, so not returning [W3C] Responding to client with driver.deleteSession() result: null [HTTP] <-- DELETE /wd/hub/session/9ae4bf70-3774-435b-9db5-88cb86bd96cc 200 1042 ms - 14 [HTTP] [HTTP] --> POST /wd/hub/session [HTTP] {"capabilities":{"firstMatch":[{"appium:app":"cn.xiaochuankeji.tieba-ih","platformName":"iOS","appium:platformVersion":"11.4.1","appium:deviceName":"testphone","appium:automationName":"XCUITest","appium:udid":"48b92f5466bb72c7b00462eea82fb2b7de976a1d","appium:newCommandTimeout":300,"appium:xcodeOrgId":"x","appium:xcodeSigningId":"iPhone Developer"}]},"desiredCapabilities":{"app":"cn.xiaochuankeji.tieba-ih","platformName":"iOS","platformVersion":"11.4.1","deviceName":"testphone","automationName":"XCUITest","udid":"48b92f5466bb72c7b00462eea82fb2b7de976a1d","newCommandTimeout":300,"xcodeOrgId":"x","xcodeSigningId":"iPhone Developer"}} [W3C] Calling AppiumDriver.createSession() with args: [{"app":"cn.xiaochuankeji.tieba-ih","platformName":"iOS","platformVersion":"11.4.1","deviceName":"testphone","automationName":"XCUITest","udid":"48b92f5466bb72c7b00462eea82fb2b7de976a1d","newCommandTimeout":300,"xcodeOrgId":"x","xcodeSigningId":"iPhone Developer"},null,{"firstMatch":[{"appium:app":"cn.xiaochuankeji.tieba-ih","platformName":"iOS","appium:platformVersion":"11.4.1","appium:deviceName":"testphone","appium:automationName":"XCUITest","appium:udid":"48b92f5466bb72c7b00462eea82fb2b7de976a1d","appium:newCommandTimeout":300,"appium:xcodeOrgId":"x","appium:xcodeSigningId":"iPhone Developer"}]}] [BaseDriver] Event 'newSessionRequested' logged at 1541403773260 (15:42:53 GMT+0800 (CST)) [Appium] Creating new XCUITestDriver (v2.94.2) session [Appium] Capabilities: [Appium] platformName: iOS [Appium] app: cn.xiaochuankeji.tieba-ih [Appium] platformVersion: 11.4.1 [Appium] deviceName: testphone [Appium] automationName: XCUITest [Appium] udid: 48b92f5466bb72c7b00462eea82fb2b7de976a1d [Appium] newCommandTimeout: 300 [Appium] xcodeOrgId: x [Appium] xcodeSigningId: iPhone Developer [BaseDriver] W3C capabilities {"alwaysMatch":{"platformNa... and MJSONWP desired capabilities {"app":"cn.xiaochuankeji.ti... were provided [BaseDriver] Creating session with W3C capabilities: {"alwaysMatch":{"platformNa... [BaseDriver] Session created with session id: 032f2183-240b-4b44-b99d-1dea0137cf18 [XCUITest] Current user: 'wangzhen' [XCUITest] Xcode version set to '10.0' [XCUITest] iOS SDK Version set to '12.0' [BaseDriver] Event 'xcodeDetailsRetrieved' logged at 1541403773392 (15:42:53 GMT+0800 (CST)) [XCUITest] Available devices: 48b92f5466bb72c7b00462eea82fb2b7de976a1d [XCUITest] Creating iDevice object with udid '48b92f5466bb72c7b00462eea82fb2b7de976a1d' [XCUITest] Determining device to run tests on: udid: '48b92f5466bb72c7b00462eea82fb2b7de976a1d', real device: true [XCUITest] App is an iOS bundle, will attempt to run as pre-existing [BaseDriver] Event 'appConfigured' logged at 1541403773852 (15:42:53 GMT+0800 (CST)) [BaseDriver] Event 'resetStarted' logged at 1541403773852 (15:42:53 GMT+0800 (CST)) [XCUITest] Reset: running ios real device reset flow [BaseDriver] Event 'resetComplete' logged at 1541403773852 (15:42:53 GMT+0800 (CST)) [iOSLog] Attempting iOS device log capture via libimobiledevice idevicesyslog [iOSLog] Starting iOS device log capture with: 'idevicesyslog' [XCUITest] Crash reports root '/Users/wangzhen/Library/Logs/CrashReporter/MobileDevice/iPhone6splus黑' does not exist. Got nothing to gather. [BaseDriver] Event 'logCaptureStarted' logged at 1541403774029 (15:42:54 GMT+0800 (CST)) [XCUITest] Setting up real device [XCUITest] Using WDA path: '/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent' [XCUITest] Using WDA agent: '/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj' [XCUITest] No obsolete cached processes from previous WDA sessions listening on port 8100 have been found [JSONWP Proxy] Matched '/status' to command name 'getStatus' [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body [JSONWP Proxy] Got response with status 200: "{\n \"value\" : {\n \"state\" : \"success\",\n \"os\" : {\n \"name\" : \"iOS\",\n \"version\" : \"11.4.1\",\n \"sdkVersion\" : \"12.0\"\n },\n \"ios\" : {\n \"simulatorVersion\" : \"11.4.1\",\n \"ip\" : \"192.168.8.208\"\n },\n \"build\" : {\n \"time\" : \"Nov 5 2018 15:12:26\",\n \"productBundleIdentifier\" : \"com.facebook.WebDriverAgentRunner\"\n }\n },\n \"sessionId\" : \"9C739371-B931-40B4-A9E6-CDA10E9B7CCE\",\n \"status\" : 0\n}" [XCUITest] Upgrade timestamp of the currently bundled WDA: 1541398943235 [XCUITest] Upgrade timestamp of the WDA on the device: undefined [XCUITest] Will reuse previously cached WDA instance at 'http://localhost:8100/' with 'com.facebook.WebDriverAgentRunner'. Set the wdaLocalPort capability to a value different from 8100 if this is an undesired behavior. [XCUITest] Trying to start WebDriverAgent 1 times with 10000ms interval [BaseDriver] Event 'wdaStartAttempted' logged at 1541403774602 (15:42:54 GMT+0800 (CST)) [XCUITest] Using provided WebdriverAgent at 'http://localhost:8100/' [BaseDriver] Event 'wdaSessionAttempted' logged at 1541403774603 (15:42:54 GMT+0800 (CST)) [XCUITest] Sending createSession command to WDA [JSONWP Proxy] Matched '/status' to command name 'getStatus' [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body [JSONWP Proxy] Got response with status 200: "{\n \"value\" : {\n \"state\" : \"success\",\n \"os\" : {\n \"name\" : \"iOS\",\n \"version\" : \"11.4.1\",\n \"sdkVersion\" : \"12.0\"\n },\n \"ios\" : {\n \"simulatorVersion\" : \"11.4.1\",\n \"ip\" : \"192.168.8.208\"\n },\n \"build\" : {\n \"time\" : \"Nov 5 2018 15:12:26\",\n \"productBundleIdentifier\" : \"com.facebook.WebDriverAgentRunner\"\n }\n },\n \"sessionId\" : \"9C739371-B931-40B4-A9E6-CDA10E9B7CCE\",\n \"status\" : 0\n}" [JSONWP Proxy] Matched '/session' to command name 'createSession' [JSONWP Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"desiredCapabilities":{"bundleId":"cn.xiaochuankeji.tieba-ih","arguments":[],"environment":{},"shouldWaitForQuiescence":true,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true}} [JSONWP Proxy] Got response with status 200: {"value":{"sessionId":"B4DF8C93-17E2-4E6C-A098-914CC3FAE3CC","capabilities":{"device":"iphone","browserName":"最右-内测","sdkVersion":"11.4.1","CFBundleIdentifier":"cn.xiaochuankeji.tieba-ih"}},"sessionId":"B4DF8C93-17E2-4E6C-A098-914CC3FAE3CC","status":0} [BaseDriver] Event 'wdaSessionStarted' logged at 1541403780295 (15:43:00 GMT+0800 (CST)) [BaseDriver] Event 'wdaStarted' logged at 1541403780296 (15:43:00 GMT+0800 (CST)) [XCUITest] Skipping setting of the initial display orientation. Set the "orientation" capability to either "LANDSCAPE" or "PORTRAIT", if this is an undesired behavior. [BaseDriver] Event 'orientationSet' logged at 1541403780296 (15:43:00 GMT+0800 (CST)) [Appium] New XCUITestDriver session created successfully, session 032f2183-240b-4b44-b99d-1dea0137cf18 added to master session list [BaseDriver] Event 'newSessionStarted' logged at 1541403780296 (15:43:00 GMT+0800 (CST)) [W3C] Cached the protocol value 'W3C' for the new session 032f2183-240b-4b44-b99d-1dea0137cf18 [W3C] Responding to client with driver.createSession() result: {"capabilities":{"webStorageEnabled":false,"locationContextEnabled":false,"browserName":"","platform":"MAC","javascriptEnabled":true,"databaseEnabled":false,"takesScreenshot":true,"networkConnectionEnabled":false,"platformName":"iOS","app":"cn.xiaochuankeji.tieba-ih","platformVersion":"11.4.1","deviceName":"testphone","automationName":"XCUITest","udid":"48b92f5466bb72c7b00462eea82fb2b7de976a1d","newCommandTimeout":300,"xcodeOrgId":"x","xcodeSigningId":"iPhone Developer"}} [HTTP] <-- POST /wd/hub/session 200 7038 ms - 565 [HTTP] [HTTP] --> POST /wd/hub/session/032f2183-240b-4b44-b99d-1dea0137cf18/element [HTTP] {"using":"accessibility id","value":"(topicButton)","sessionId":"032f2183-240b-4b44-b99d-1dea0137cf18"} [W3C] Calling AppiumDriver.findElement() with args: ["accessibility id","(topicButton)","032f2183-240b-4b44-b99d-1dea0137cf18"] [XCUITest] Executing command 'findElement' [BaseDriver] Valid locator strategies for this request: xpath, id, name, class name, -ios predicate string, -ios class chain, accessibility id [BaseDriver] Waiting up to 0 ms for condition [JSONWP Proxy] Matched '/element' to command name 'findElement' [JSONWP Proxy] Proxying [POST /element] to [POST http://localhost:8100/session/B4DF8C93-17E2-4E6C-A098-914CC3FAE3CC/element] with body: {"using":"accessibility id","value":"(topicButton)"} [JSONWP Proxy] Got response with status 200: {"value":{"ELEMENT":"00000000-0000-0000-0000-000000000000"},"sessionId":"B4DF8C93-17E2-4E6C-A098-914CC3FAE3CC","status":0} [W3C] Responding to client with driver.findElement() result: {"element-6066-11e4-a52e-4f735466cecf":"00000000-0000-0000-0000-000000000000"} [HTTP] <-- POST /wd/hub/session/032f2183-240b-4b44-b99d-1dea0137cf18/element 200 7218 ms - 88 [HTTP] [HTTP] --> POST /wd/hub/session/032f2183-240b-4b44-b99d-1dea0137cf18/element/00000000-0000-0000-0000-000000000000/click [HTTP] {"id":"00000000-0000-0000-0000-000000000000","sessionId":"032f2183-240b-4b44-b99d-1dea0137cf18"} [W3C] Driver proxy active, passing request on via HTTP proxy [XCUITest] Executing command 'proxyReqRes' [JSONWP Proxy] Matched '/wd/hub/session/032f2183-240b-4b44-b99d-1dea0137cf18/element/00000000-0000-0000-0000-000000000000/click' to command name 'click' [JSONWP Proxy] Proxying [POST /wd/hub/session/032f2183-240b-4b44-b99d-1dea0137cf18/element/00000000-0000-0000-0000-000000000000/click] to [POST http://localhost:8100/session/B4DF8C93-17E2-4E6C-A098-914CC3FAE3CC/element/00000000-0000-0000-0000-000000000000/click] with body: {"id":"00000000-0000-0000-0000-000000000000","sessionId":"032f2183-240b-4b44-b99d-1dea0137cf18"} [JSONWP Proxy] Got response with status 200: {"value":"Error Domain=com.facebook.WebDriverAgent Code=1 \"The element '\"(topicButton)\" Button' is not visible on the screen and thus is not interactable\" UserInfo={NSLocalizedDescription=The element '\"(topicButton)\" Button' is not visible on the screen and thus is not interactable}","sessionId":"B4DF8C93-17E2-4E6C-A098-914CC3FAE3CC","status":13} [W3C] Encountered internal error running command: ProxyRequestError: Could not proxy command to remote server. Original error: The request to /wd/hub/session/032f2183-240b-4b44-b99d-1dea0137cf18/element/00000000-0000-0000-0000-000000000000/click has failed [W3C] at JWProxy.proxy$ (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-base-driver/lib/jsonwp-proxy/proxy.js:182:13) [W3C] at tryCatch (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40) [W3C] at GeneratorFunctionPrototype.invoke [as _invoke] (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22) [W3C] at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21) [W3C] at GeneratorFunctionPrototype.invoke (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37) [W3C] at [MJSONWP] Matched JSONWP error code 13 to UnknownError [HTTP] <-- POST /wd/hub/session/032f2183-240b-4b44-b99d-1dea0137cf18/element/00000000-0000-0000-0000-000000000000/click 500 71964 ms - 2018 [HTTP] [HTTP] --> DELETE /wd/hub/session/032f2183-240b-4b44-b99d-1dea0137cf18 [HTTP] {} [W3C] Calling AppiumDriver.deleteSession() with args: ["032f2183-240b-4b44-b99d-1dea0137cf18"] [BaseDriver] Event 'quitSessionRequested' logged at 1541403862498 (15:44:22 GMT+0800 (CST)) [Appium] Removing session 032f2183-240b-4b44-b99d-1dea0137cf18 from our master session list [JSONWP Proxy] Matched '/session/032f2183-240b-4b44-b99d-1dea0137cf18' to command name 'deleteSession' [JSONWP Proxy] Proxying [DELETE /session/032f2183-240b-4b44-b99d-1dea0137cf18] to [DELETE http://localhost:8100/session/B4DF8C93-17E2-4E6C-A098-914CC3FAE3CC] with no body [JSONWP Proxy] Got response with status 200: "{\n \"value\" : {\n\n },\n \"sessionId\" : \"B9A309AC-5385-4DF8-BE94-19B80225807C\",\n \"status\" : 0\n}" [XCUITest] Not clearing log files. Use clearSystemFiles capability to turn on. [BaseDriver] Event 'quitSessionFinished' logged at 1541403863549 (15:44:23 GMT+0800 (CST)) [W3C] Received response: null [W3C] But deleting session, so not returning [W3C] Responding to client with driver.deleteSession() result: null [HTTP] <-- DELETE /wd/hub/session/032f2183-240b-4b44-b99d-1dea0137cf18 200 1053 ms - 14 [HTTP] [XCUITest] Connection to WDA timed out [iProxy] recv failed: Operation not permitted

DoraNemet commented 5 years ago

I have the same issue but for XCUIElementTypeTextField. Inspector says that XCUIElementTypeTextField is enabled and visible. PageSource says <XCUIElementTypeTextField type="XCUIElementTypeTextField" value="elementName" enabled="true" visible="true" x="61" y="162" width="298" height="48"/> findElements(By.className("XCUIElementTypeTextField")) finds the element on the screen. But I get "Code=1 "The element '"elementName" TextField' is not visible on the screen and thus is not interactable" when I try to clear() or click() the element.

List <IOSElement> fields = getIOSDriver().findElements(By.className("XCUIElementTypeTextField"));
                fields.get(0).clear();
                fields.get(0).sendKeys("text"); //first element works
                locateElementAndClick(done);
                fields.get(1).sendKeys("5"); //this fails
                locateElementAndClick(done);

Appium logs https://gist.github.com/deedora/03deba2a2210b30789b5742348595fb6

Xcode 10.1 real device iOS 12.1 Appium 1.10.0

hemantbanafal commented 5 years ago

Any updates on this issue? I am also facing the same issue Web driver exception: The following error occurred: An unknown server-side error occurred while processing the command. Original error: Error Domain=com.facebook.WebDriverAgent Code=1 'The element ''ILMatchTableViewCell_matchCell' Cell' is not visible on the screen and thus is not interactable' UserInfo={NSLocalizedDescription=The element ''ILMatchTableViewCell_matchCell' Cell' is not visible on the screen and thus is not interactable}

Is this specific to Appium 1.10.0 or it is there on previous versions also? I am not aware about this issue on previous versions. Will switching back to 1.9.1 fix this issue ?

sumanthvakacharla commented 5 years ago

Xcode 10.1 Simulator device iOS 12.1 Appium 1.9.0 Same issue with send_keys, Not sending for other elements

WebDriverException: Message: An unknown server-side error occurred while processing the command. Original error: Error Domain=com.facebook.WebDriverAgent Code=1 “The element ‘“500" TextField’ is not visible on the screen and thus is not interactable” UserInfo={NSLocalizedDescription=The element ‘“500” TextField’ is not visible on the screen and thus is not interactable}

barisiriz1 commented 5 years ago

any update ?

sumanthvakacharla commented 5 years ago

Mine got resolved. I have told my developers to look into this. And they have added some accessibility id related lines of code to their Swift. And its working Now! Confirmed its not a problem with Appium

giann commented 5 years ago

I have the same issue. The element if found (but sometimes have a weird id 00000000-0000-0000-0000-000000000000) but I get the error message mentionned above.

Tried with both webdriver/appium/browserstack and webdriverio/appium/browserstack.

The element is well visible and interactable with from appium GUI.

sumanthvakacharla commented 5 years ago

@giann Ask your developers to try adding accessibility.identifier property set to True to that view

hardik-plume commented 5 years ago

I am getting the same error on random fields where accessibility identifier is set on the element