appium / appium-mac2-driver

Next-gen Appium macOS driver, backed by Apple XCTest
Apache License 2.0
115 stars 24 forks source link

Session is killed for no reason #260

Open pppppino opened 6 months ago

pppppino commented 6 months ago

Env: Appium: latest Mac 2 Driver: latest I found that my running job is failed for the session is killed, however, I don't know why the session is killed!


log


[HTTP] {"using":"-ios class chain","value":"/XCUIElementTypeTable[label == \"History\"]//XCUIElementTypeButton[label == \"More\"]"} [debug] [Mac2Driver@6137 (ef8258e1)] Calling AppiumDriver.findElements() with args: ["-ios class chain","/XCUIElementTypeTable[label == \"History\"]//XCUIElementTypeButton[label == \"More\"]","ef8258e1-1863-4856-b6f5-28d1d280d6b8"] [debug] [Mac2Driver@6137 (ef8258e1)] Valid locator strategies for this request: id, name, accessibility id, xpath, class name, -ios predicate string, predicate string, -ios class chain, class chain [debug] [WD Proxy] Matched '/elements' to command name 'findElements' [debug] [WD Proxy] Proxying [POST /elements] to [POST http://127.0.0.1:10100/session/7AFF776F-4FBA-41BC-954F-5335FD682E7F/elements] with body: {"using":"class chain","value":"/XCUIElementTypeTable[label == \"History\"]//XCUIElementTypeButton[label == \"More\"]"} [debug] [WD Proxy] Got response with status 200: {"value":[{"ELEMENT":"F3DC980F-D7EE-48EF-9F6C-24B5C47561F8","element-6066-11e4-a52e-4f735466cecf":"F3DC980F-D7EE-48EF-9F6C-24B5C47561F8"}],"sessionId":"7AFF776F-4FBA-41BC-954F-5335FD682E7F"} [debug] [Mac2Driver@6137 (ef8258e1)] Responding to client with driver.findElements() result: [{"element-6066-11e4-a52e-4f735466cecf":"F3DC980F-D7EE-48EF-9F6C-24B5C47561F8","ELEMENT":"F3DC980F-D7EE-48EF-9F6C-24B5C47561F8"}] [HTTP] <-- POST /session/ef8258e1-1863-4856-b6f5-28d1d280d6b8/elements 200 92 ms - 139 [HTTP]  [HTTP] --> POST /session/ef8258e1-1863-4856-b6f5-28d1d280d6b8/element/F3DC980F-D7EE-48EF-9F6C-24B5C47561F8/click [HTTP] {} [Mac2Driver@6137 (ef8258e1)] Driver proxy active, passing request on via HTTP proxy [debug] [WD Proxy] Matched '/session/ef8258e1-1863-4856-b6f5-28d1d280d6b8/element/F3DC980F-D7EE-48EF-9F6C-24B5C47561F8/click' to command name 'click' [debug] [WD Proxy] Proxying [POST /session/ef8258e1-1863-4856-b6f5-28d1d280d6b8/element/F3DC980F-D7EE-48EF-9F6C-24B5C47561F8/click] to [POST http://127.0.0.1:10100/session/7AFF776F-4FBA-41BC-954F-5335FD682E7F/element/F3DC980F-D7EE-48EF-9F6C-24B5C47561F8/click] with body: {} [debug] [WD Proxy] Got response with status 200: {"value":null,"sessionId":"7AFF776F-4FBA-41BC-954F-5335FD682E7F"} [WD Proxy] Replacing sessionId 7AFF776F-4FBA-41BC-954F-5335FD682E7F with ef8258e1-1863-4856-b6f5-28d1d280d6b8 [HTTP] <-- POST /session/ef8258e1-1863-4856-b6f5-28d1d280d6b8/element/F3DC980F-D7EE-48EF-9F6C-24B5C47561F8/click 200 647 ms - 65 [HTTP]  [HTTP] --> POST /session/ef8258e1-1863-4856-b6f5-28d1d280d6b8/element [HTTP] {"using":"xpath","value":"//XCUIElementTypeOther[@label = \"Block Number\"]/.."} [debug] [Mac2Driver@6137 (ef8258e1)] Calling AppiumDriver.findElement() with args: ["xpath","//XCUIElementTypeOther[@label = \"Block Number\"]/..","ef8258e1-1863-4856-b6f5-28d1d280d6b8"] [debug] [Mac2Driver@6137 (ef8258e1)] Valid locator strategies for this request: id, name, accessibility id, xpath, class name, -ios predicate string, predicate string, -ios class chain, class chain [debug] [WD Proxy] Matched '/element' to command name 'findElement' [debug] [WD Proxy] Proxying [POST /element] to [POST http://127.0.0.1:10100/session/7AFF776F-4FBA-41BC-954F-5335FD682E7F/element] with body: {"using":"xpath","value":"//XCUIElementTypeOther[@label = \"Block Number\"]/.."} [debug] [WD Proxy] Got response with status 200: {"value":{"ELEMENT":"31F9E236-3532-405C-B3F6-8749A4777495","element-6066-11e4-a52e-4f735466cecf":"31F9E236-3532-405C-B3F6-8749A4777495"},"sessionId":"7AFF776F-4FBA-41BC-954F-5335FD682E7F"} [debug] [Mac2Driver@6137 (ef8258e1)] Responding to client with driver.findElement() result: {"element-6066-11e4-a52e-4f735466cecf":"31F9E236-3532-405C-B3F6-8749A4777495","ELEMENT":"31F9E236-3532-405C-B3F6-8749A4777495"} [HTTP] <-- POST /session/ef8258e1-1863-4856-b6f5-28d1d280d6b8/element 200 469 ms - 137 [HTTP]  [HTTP] --> POST /session/ef8258e1-1863-4856-b6f5-28d1d280d6b8/element/31F9E236-3532-405C-B3F6-8749A4777495/click [HTTP] {} [Mac2Driver@6137 (ef8258e1)] Driver proxy active, passing request on via HTTP proxy [debug] [WD Proxy] Matched '/session/ef8258e1-1863-4856-b6f5-28d1d280d6b8/element/31F9E236-3532-405C-B3F6-8749A4777495/click' to command name 'click' [debug] [WD Proxy] Proxying [POST /session/ef8258e1-1863-4856-b6f5-28d1d280d6b8/element/31F9E236-3532-405C-B3F6-8749A4777495/click] to [POST http://127.0.0.1:10100/session/7AFF776F-4FBA-41BC-954F-5335FD682E7F/element/31F9E236-3532-405C-B3F6-8749A4777495/click] with body: {} [debug] [WD Proxy] Got response with status 200: {"value":null,"sessionId":"7AFF776F-4FBA-41BC-954F-5335FD682E7F"} [WD Proxy] Replacing sessionId 7AFF776F-4FBA-41BC-954F-5335FD682E7F with ef8258e1-1863-4856-b6f5-28d1d280d6b8 [HTTP] <-- POST /session/ef8258e1-1863-4856-b6f5-28d1d280d6b8/element/31F9E236-3532-405C-B3F6-8749A4777495/click 200 768 ms - 65 [HTTP]  [HTTP] --> POST /session/ef8258e1-1863-4856-b6f5-28d1d280d6b8/element [HTTP] {"using":"xpath","value":"//XCUIElementTypeOther[@label = \"Spam Calls\"]/.."} [debug] [Mac2Driver@6137 (ef8258e1)] Calling AppiumDriver.findElement() with args: ["xpath","//XCUIElementTypeOther[@label = \"Spam Calls\"]/..","ef8258e1-1863-4856-b6f5-28d1d280d6b8"] [debug] [Mac2Driver@6137 (ef8258e1)] Valid locator strategies for this request: id, name, accessibility id, xpath, class name, -ios predicate string, predicate string, -ios class chain, class chain [debug] [WD Proxy] Matched '/element' to command name 'findElement' [debug] [WD Proxy] Proxying [POST /element] to [POST http://127.0.0.1:10100/session/7AFF776F-4FBA-41BC-954F-5335FD682E7F/element] with body: {"using":"xpath","value":"//XCUIElementTypeOther[@label = \"Spam Calls\"]/.."} [debug] [WD Proxy] Got response with status 200: {"value":{"ELEMENT":"F0B373E5-8DCC-4DF8-B2BE-5EB5B8BF3A65","element-6066-11e4-a52e-4f735466cecf":"F0B373E5-8DCC-4DF8-B2BE-5EB5B8BF3A65"},"sessionId":"7AFF776F-4FBA-41BC-954F-5335FD682E7F"} [debug] [Mac2Driver@6137 (ef8258e1)] Responding to client with driver.findElement() result: {"element-6066-11e4-a52e-4f735466cecf":"F0B373E5-8DCC-4DF8-B2BE-5EB5B8BF3A65","ELEMENT":"F0B373E5-8DCC-4DF8-B2BE-5EB5B8BF3A65"} [HTTP] <-- POST /session/ef8258e1-1863-4856-b6f5-28d1d280d6b8/element 200 497 ms - 137 [HTTP]  [HTTP] --> POST /session/ef8258e1-1863-4856-b6f5-28d1d280d6b8/element/F0B373E5-8DCC-4DF8-B2BE-5EB5B8BF3A65/click [HTTP] {} [Mac2Driver@6137 (ef8258e1)] Driver proxy active, passing request on via HTTP proxy [debug] [WD Proxy] Matched '/session/ef8258e1-1863-4856-b6f5-28d1d280d6b8/element/F0B373E5-8DCC-4DF8-B2BE-5EB5B8BF3A65/click' to command name 'click' [debug] [WD Proxy] Proxying [POST /session/ef8258e1-1863-4856-b6f5-28d1d280d6b8/element/F0B373E5-8DCC-4DF8-B2BE-5EB5B8BF3A65/click] to [POST http://127.0.0.1:10100/session/7AFF776F-4FBA-41BC-954F-5335FD682E7F/element/F0B373E5-8DCC-4DF8-B2BE-5EB5B8BF3A65/click] with body: {} [debug] [WD Proxy] Got response with status 200: {"value":null,"sessionId":"7AFF776F-4FBA-41BC-954F-5335FD682E7F"} [WD Proxy] Replacing sessionId 7AFF776F-4FBA-41BC-954F-5335FD682E7F with ef8258e1-1863-4856-b6f5-28d1d280d6b8 [HTTP] <-- POST /session/ef8258e1-1863-4856-b6f5-28d1d280d6b8/element/F0B373E5-8DCC-4DF8-B2BE-5EB5B8BF3A65/click 200 810 ms - 65 [HTTP]  [HTTP] --> POST /session/ef8258e1-1863-4856-b6f5-28d1d280d6b8/element [HTTP] {"using":"-ios class chain","value":"/XCUIElementTypeButton[label == \"Block\"]"} [debug] [Mac2Driver@6137 (ef8258e1)] Calling AppiumDriver.findElement() with args: ["-ios class chain","/XCUIElementTypeButton[label == \"Block\"]","ef8258e1-1863-4856-b6f5-28d1d280d6b8"] [debug] [Mac2Driver@6137 (ef8258e1)] Valid locator strategies for this request: id, name, accessibility id, xpath, class name, -ios predicate string, predicate string, -ios class chain, class chain [debug] [WD Proxy] Matched '/element' to command name 'findElement' [debug] [WD Proxy] Proxying [POST /element] to [POST http://127.0.0.1:10100/session/7AFF776F-4FBA-41BC-954F-5335FD682E7F/element] with body: {"using":"class chain","value":"/XCUIElementTypeButton[label == \"Block\"]"} [debug] [WD Proxy] Got response with status 200: {"value":{"ELEMENT":"F0B9BC3E-8F05-4E6A-9F4D-DFC661518F06","element-6066-11e4-a52e-4f735466cecf":"F0B9BC3E-8F05-4E6A-9F4D-DFC661518F06"},"sessionId":"7AFF776F-4FBA-41BC-954F-5335FD682E7F"} [debug] [Mac2Driver@6137 (ef8258e1)] Responding to client with driver.findElement() result: {"element-6066-11e4-a52e-4f735466cecf":"F0B9BC3E-8F05-4E6A-9F4D-DFC661518F06","ELEMENT":"F0B9BC3E-8F05-4E6A-9F4D-DFC661518F06"} [HTTP] <-- POST /session/ef8258e1-1863-4856-b6f5-28d1d280d6b8/element 200 119 ms - 137 [HTTP]  [HTTP] --> POST /session/ef8258e1-1863-4856-b6f5-28d1d280d6b8/element/F0B9BC3E-8F05-4E6A-9F4D-DFC661518F06/click [HTTP] {} [Mac2Driver@6137 (ef8258e1)] Driver proxy active, passing request on via HTTP proxy [debug] [WD Proxy] Matched '/session/ef8258e1-1863-4856-b6f5-28d1d280d6b8/element/F0B9BC3E-8F05-4E6A-9F4D-DFC661518F06/click' to command name 'click' [debug] [WD Proxy] Proxying [POST /session/ef8258e1-1863-4856-b6f5-28d1d280d6b8/element/F0B9BC3E-8F05-4E6A-9F4D-DFC661518F06/click] to [POST http://127.0.0.1:10100/session/7AFF776F-4FBA-41BC-954F-5335FD682E7F/element/F0B9BC3E-8F05-4E6A-9F4D-DFC661518F06/click] with body: {} [debug] [WD Proxy] Got response with status 200: {"value":null,"sessionId":"7AFF776F-4FBA-41BC-954F-5335FD682E7F"} [WD Proxy] Replacing sessionId 7AFF776F-4FBA-41BC-954F-5335FD682E7F with ef8258e1-1863-4856-b6f5-28d1d280d6b8 [HTTP] <-- POST /session/ef8258e1-1863-4856-b6f5-28d1d280d6b8/element/F0B9BC3E-8F05-4E6A-9F4D-DFC661518F06/click 200 563 ms - 65 [HTTP]  [HTTP] --> DELETE /session/15f76f98-30d5-476f-95b4-95d2a7b2f910 [HTTP] {} [debug] [Mac2Driver@3573 (15f76f98)] Calling AppiumDriver.deleteSession() with args: ["15f76f98-30d5-476f-95b4-95d2a7b2f910"] [debug] [AppiumDriver@2e2e] Event 'quitSessionRequested' logged at 1701914493690 (10:01:33 GMT+0800 (China Standard Time)) [AppiumDriver@2e2e] Removing session 15f76f98-30d5-476f-95b4-95d2a7b2f910 from our master session list [debug] [WD Proxy] Matched '/session/7AFF776F-4FBA-41BC-954F-5335FD682E7F' to command name 'deleteSession' [debug] [WD Proxy] Proxying [DELETE /session/7AFF776F-4FBA-41BC-954F-5335FD682E7F] to [DELETE http://127.0.0.1:10100/session/7AFF776F-4FBA-41BC-954F-5335FD682E7F] with no body [debug] [WD Proxy] Got response with status 200: {"value":null,"sessionId":null} [debug] [AppiumDriver@2e2e] Event 'quitSessionFinished' logged at 1701914493695 (10:01:33 GMT+0800 (China Standard Time)) [debug] [AppiumDriver@2e2e] Received response: null [debug] [AppiumDriver@2e2e] But deleting session, so not returning [debug] [AppiumDriver@2e2e] Responding to client with driver.deleteSession() result: null [HTTP] <-- DELETE /session/15f76f98-30d5-476f-95b4-95d2a7b2f910 200 6 ms - 14 [HTTP]  [HTTP] --> POST /session/ef8258e1-1863-4856-b6f5-28d1d280d6b8/element [HTTP] {"using":"-ios predicate string","value":"label == \"Ignore\""} [debug] [Mac2Driver@6137 (ef8258e1)] Calling AppiumDriver.findElement() with args: ["-ios predicate string","label == \"Ignore\"","ef8258e1-1863-4856-b6f5-28d1d280d6b8"] [debug] [Mac2Driver@6137 (ef8258e1)] Valid locator strategies for this request: id, name, accessibility id, xpath, class name, -ios predicate string, predicate string, -ios class chain, class chain [debug] [WD Proxy] Matched '/element' to command name 'findElement' [debug] [WD Proxy] Proxying [POST /element] to [POST http://127.0.0.1:10100/session/7AFF776F-4FBA-41BC-954F-5335FD682E7F/element] with body: {"using":"predicate string","value":"label == \"Ignore\""} [WD Proxy] Got response with status 404: {"value":{"error":"invalid session id","message":"Session does not exist","traceback":"(\n\t0 CoreFoundation 0x00007ff8024db18a __exceptionPreprocess + 242\n\t1 libobjc.A.dylib 0x00007ff80200142b objc_exception_throw + 48\n\t2 CoreFoundation 0x00007ff8025032f6 -[NSException raise] + 9\n\t3 WebDriverAgentLib 0x000000010905d016 -[FBRoute raiseNoSessionException] + 86\n\t4 WebDriverAgentLib 0x000000010905cf63 -[FBRoute decorateRequest:] + 259\n\t5 WebDriverAgentLib 0x000000010905c39a -[FBRoute_TargetAction mountRequest:intoResponse:] + 90\n\t6 WebDriverAgentLib 0x0000000109055aa8 37-[FBWebServer registerRouteHandlers:]_block_invoke + 776\n\t7 WebDriverAgentLib 0x000000010904f19d -[RoutingHTTPServer handleRoute:withRequest:response:] + 189\n\t8 WebDriverAgentLib 0x000000010904fee1 72-[RoutingHTTPServer routeMethod:withPat... [debug] [W3C] Matched W3C error code 'invalid session id' to NoSuchDriverError [debug] [Mac2Driver@6137 (ef8258e1)] Encountered internal error running command: NoSuchDriverError: Session does not exist [debug] [Mac2Driver@6137 (ef8258e1)] at errorFromW3CJsonCode (/usr/local/lib/node_modules/appium/node_modules/@appium/base-driver/lib/protocol/errors.js:1059:25) [debug] [Mac2Driver@6137 (ef8258e1)] at ProxyRequestError.getActualError (/usr/local/lib/node_modules/appium/node_modules/@appium/base-driver/lib/protocol/errors.js:928:14) [debug] [Mac2Driver@6137 (ef8258e1)] at WDAMacProxy.command (/usr/local/lib/node_modules/appium/node_modules/@appium/base-driver/lib/jsonwp-proxy/proxy.js:353:19) [debug] [Mac2Driver@6137 (ef8258e1)] at processTicksAndRejections (node:internal/process/task_queues:95:5) [debug] [Mac2Driver@6137 (ef8258e1)] at Mac2Driver.findElOrEls (/Users/admin/.appium/node_modules/appium-mac2-driver/lib/commands/find.js:17:10) [debug] [Mac2Driver@6137 (ef8258e1)] at Mac2Driver.findElOrElsWithProcessing (/usr/local/lib/node_modules/appium/node_modules/@appium/base-driver/lib/basedriver/commands/find.ts:60:12) [debug] [Mac2Driver@6137 (ef8258e1)] at Mac2Driver.findElement (/usr/local/lib/node_modules/appium/node_modules/@appium/base-driver/lib/basedriver/commands/find.ts:75:12) [HTTP] <-- POST /session/ef8258e1-1863-4856-b6f5-28d1d280d6b8/element 404 9 ms - 1014 [HTTP]  [HTTP] --> POST /session/ef8258e1-1863-4856-b6f5-28d1d280d6b8/element [HTTP] {"using":"-ios class chain","value":"/XCUIElementTypeTable[label == \"History\"]/XCUIElementTypeTableRow[1]"} [debug] [Mac2Driver@6137 (ef8258e1)] Calling AppiumDriver.findElement() with args: ["-ios class chain","/XCUIElementTypeTable[label == \"History\"]/XCUIElementTypeTableRow[1]","ef8258e1-1863-4856-b6f5-28d1d280d6b8"] [debug] [Mac2Driver@6137 (ef8258e1)] Valid locator strategies for this request: id, name, accessibility id, xpath, class name, -ios predicate string, predicate string, -ios class chain, class chain [debug] [WD Proxy] Matched '/element' to command name 'findElement' [debug] [WD Proxy] Proxying [POST /element] to [POST http://127.0.0.1:10100/session/7AFF776F-4FBA-41BC-954F-5335FD682E7F/element] with body: {"using":"class chain","value":"/XCUIElementTypeTable[label == \"History\"]/XCUIElementTypeTableRow[1]"} [WD Proxy] Got response with status 404: {"value":{"error":"invalid session id","message":"Session does not exist","traceback":"(\n\t0 CoreFoundation 0x00007ff8024db18a exceptionPreprocess + 242\n\t1 libobjc.A.dylib 0x00007ff80200142b objc_exception_throw + 48\n\t2 CoreFoundation 0x00007ff8025032f6 -[NSException raise] + 9\n\t3 WebDriverAgentLib 0x000000010905d016 -[FBRoute raiseNoSessionException] + 86\n\t4 WebDriverAgentLib 0x000000010905cf63 -[FBRoute decorateRequest:] + 259\n\t5 WebDriverAgentLib 0x000000010905c39a -[FBRoute_TargetAction mountRequest:intoResponse:] + 90\n\t6 WebDriverAgentLib 0x0000000109055aa8 37-[FBWebServer registerRouteHandlers:]_block_invoke + 776\n\t7 WebDriverAgentLib 0x000000010904f19d -[RoutingHTTPServer handleRoute:withRequest:response:] + 189\n\t8 WebDriverAgentLib 0x000000010904fee1 72-[RoutingHTTPServer routeMethod:withPat... [debug] [W3C] Matched W3C error code 'invalid session id' to NoSuchDriverError [debug] [Mac2Driver@6137 (ef8258e1)] Encountered internal error running command: NoSuchDriverError: Session does not exist [debug] [Mac2Driver@6137 (ef8258e1)] at errorFromW3CJsonCode (/usr/local/lib/node_modules/appium/node_modules/@appium/base-driver/lib/protocol/errors.js:1059:25) [debug] [Mac2Driver@6137 (ef8258e1)] at ProxyRequestError.getActualError (/usr/local/lib/node_modules/appium/node_modules/@appium/base-driver/lib/protocol/errors.js:928:14) [debug] [Mac2Driver@6137 (ef8258e1)] at WDAMacProxy.command (/usr/local/lib/node_modules/appium/node_modules/@appium/base-driver/lib/jsonwp-proxy/proxy.js:353:19) [debug] [Mac2Driver@6137 (ef8258e1)] at processTicksAndRejections (node:internal/process/task_queues:95:5) [debug] [Mac2Driver@6137 (ef8258e1)] at Mac2Driver.findElOrEls (/Users/admin/.appium/node_modules/appium-mac2-driver/lib/commands/find.js:17:10) [debug] [Mac2Driver@6137 (ef8258e1)] at Mac2Driver.findElOrElsWithProcessing (/usr/local/lib/node_modules/appium/node_modules/@appium/base-driver/lib/basedriver/commands/find.ts:60:12) [debug] [Mac2Driver@6137 (ef8258e1)] at Mac2Driver.findElement (/usr/local/lib/node_modules/appium/node_modules/@appium/base-driver/lib/basedriver/commands/find.ts:75:12) [HTTP] <-- POST /session/ef8258e1-1863-4856-b6f5-28d1d280d6b8/element 404 8 ms - 1014 [HTTP]  [HTTP] --> GET /sessions [HTTP] {} [debug] [AppiumDriver@2e2e] Calling AppiumDriver.getSessions() with args: [] [debug] [AppiumDriver@2e2e] Responding to client with driver.getSessions() result: [{"id":"3a22204e-c801-49f0-bfa3-335b71038c2b","capabilities":{"platformName":"mac","automationName":"Mac2","bundleId":"us.zoom.xos","deviceName":"10.100.89.17","newCommandTimeout":3600,"noReset":true}},{"id":"8bee5faf-c224-4edf-9607-3f040a5269ab","capabilities":{"platformName":"mac","automationName":"Mac2","bundleId":"us.zoom.xos","deviceName":"10.100.89.17","newCommandTimeout":3600,"noReset":true}},{"id":"227210b3-e145-464b-a060-dfa45d4fadea","capabilities":{"platformName":"mac","automationName":"Mac2","bundleId":"us.zoom.xos","deviceName":"10.100.89.17","newCommandTimeout":3600,"noReset":true}},{"id":"725f0a91-c6f3-4c31-be24-b7130e51b80f","capabilities":{"platformName":"mac","automationName":"Mac2","bundleId":"us.zoom.xos","deviceName":"10.100.89.17","newCommandTimeout":3600,"noReset":true}},{"id":"62fa0dbf-97a4-47dd-9862-43ce743920c2","capabilities":{"platformName":"mac","automationName":"Mac2","bundleId":"us.zoom.xos","deviceName":"10.100.89.17","newCommandTimeout":3600,"noReset":true}},{"id":"ef8258e1... [HTTP] <-- GET /sessions 200 3 ms - 1217 [HTTP]  [HTTP] --> GET /sessions [HTTP] {} [debug] [AppiumDriver@2e2e] Calling AppiumDriver.getSessions() with args: [] [debug] [AppiumDriver@2e2e] Responding to client with driver.getSessions() result: [{"id":"3a22204e-c801-49f0-bfa3-335b71038c2b","capabilities":{"platformName":"mac","automationName":"Mac2","bundleId":"us.zoom.xos","deviceName":"10.100.89.17","newCommandTimeout":3600,"noReset":true}},{"id":"8bee5faf-c224-4edf-9607-3f040a5269ab","capabilities":{"platformName":"mac","automationName":"Mac2","bundleId":"us.zoom.xos","deviceName":"10.100.89.17","newCommandTimeout":3600,"noReset":true}},{"id":"227210b3-e145-464b-a060-dfa45d4fadea","capabilities":{"platformName":"mac","automationName":"Mac2","bundleId":"us.zoom.xos","deviceName":"10.100.89.17","newCommandTimeout":3600,"noReset":true}},{"id":"725f0a91-c6f3-4c31-be24-b7130e51b80f","capabilities":{"platformName":"mac","automationName":"Mac2","bundleId":"us.zoom.xos","deviceName":"10.100.89.17","newCommandTimeout":3600,"noReset":true}},{"id":"62fa0dbf-97a4-47dd-9862-43ce743920c2","capabilities":{"platformName":"mac","automationName":"Mac2","bundleId":"us.zoom.xos","deviceName":"10.100.89.17","newCommandTimeout":3600,"noReset":true}},{"id":"ef8258e1... [HTTP] <-- GET /sessions 304 2 ms - - [HTTP]  [HTTP] --> POST /session/ef8258e1-1863-4856-b6f5-28d1d280d6b8/execute/sync [HTTP] {"script":"macos: screenshots","args":[]} [debug] [Mac2Driver@6137 (ef8258e1)] Calling AppiumDriver.execute() with args: ["macos: screenshots",[],"ef8258e1-1863-4856-b6f5-28d1d280d6b8"] [Mac2Driver] Executing extension command 'macos: screenshots' [debug] [WD Proxy] Proxying [POST /wda/screenshots] to [POST http://127.0.0.1:10100/session/7AFF776F-4FBA-41BC-954F-5335FD682E7F/wda/screenshots] with body: {} [WD Proxy] Got response with status 404: {"value":{"error":"invalid session id","message":"Session does not exist","traceback":"(\n\t0 CoreFoundation 0x00007ff8024db18a __exceptionPreprocess + 242\n\t1 libobjc.A.dylib 0x00007ff80200142b objc_exception_throw + 48\n\t2 CoreFoundation 0x00007ff8025032f6 -[NSException raise] + 9\n\t3 WebDriverAgentLib 0x000000010905d016 -[FBRoute raiseNoSessionException] + 86\n\t4 WebDriverAgentLib 0x000000010905cf63 -[FBRoute decorateRequest:] + 259\n\t5 WebDriverAgentLib 0x000000010905c39a -[FBRoute_TargetAction mountRequest:intoResponse:] + 90\n\t6 WebDriverAgentLib 0x0000000109055aa8 37-[FBWebServer registerRouteHandlers:]_block_invoke + 776\n\t7 WebDriverAgentLib 0x000000010904f19d -[RoutingHTTPServer handleRoute:withRequest:response:] + 189\n\t8 WebDriverAgentLib 0x000000010904fee1 72-[RoutingHTTPServer routeMethod:withPat... [debug] [W3C] Matched W3C error code 'invalid session id' to NoSuchDriverError [debug] [Mac2Driver@6137 (ef8258e1)] Encountered internal error running command: NoSuchDriverError: Session does not exist [debug] [Mac2Driver@6137 (ef8258e1)] at errorFromW3CJsonCode (/usr/local/lib/node_modules/appium/node_modules/@appium/base-driver/lib/protocol/errors.js:1059:25) [debug] [Mac2Driver@6137 (ef8258e1)] at ProxyRequestError.getActualError (/usr/local/lib/node_modules/appium/node_modules/@appium/base-driver/lib/protocol/errors.js:928:14) [debug] [Mac2Driver@6137 (ef8258e1)] at WDAMacProxy.command (/usr/local/lib/node_modules/appium/node_modules/@appium/base-driver/lib/jsonwp-proxy/proxy.js:353:19) [debug] [Mac2Driver@6137 (ef8258e1)] at processTicksAndRejections (node:internal/process/task_queues:95:5) [debug] [Mac2Driver@6137 (ef8258e1)] at Mac2Driver.macosScreenshots (/Users/admin/.appium/node_modules/appium-mac2-driver/lib/commands/screenshots.js:28:10) [debug] [Mac2Driver@6137 (ef8258e1)] at Mac2Driver.executeMacosCommand (/Users/admin/.appium/node_modules/appium-mac2-driver/lib/commands/execute.js:54:10) [debug] [Mac2Driver@6137 (ef8258e1)] at Mac2Driver.execute (/Users/admin/.appium/node_modules/appium-mac2-driver/lib/commands/execute.js:44:12) [HTTP] <-- POST /session/ef8258e1-1863-4856-b6f5-28d1d280d6b8/execute/sync 404 23 ms - 970 [HTTP]  [HTTP] --> DELETE /session/ef8258e1-1863-4856-b6f5-28d1d280d6b8 [HTTP] {} [debug] [Mac2Driver@6137 (ef8258e1)] Calling AppiumDriver.deleteSession() with args: ["ef8258e1-1863-4856-b6f5-28d1d280d6b8"] [debug] [AppiumDriver@2e2e] Event 'quitSessionRequested' logged at 1701914495657 (10:01:35 GMT+0800 (China Standard Time)) [AppiumDriver@2e2e] Removing session ef8258e1-1863-4856-b6f5-28d1d280d6b8 from our master session list [debug] [WD Proxy] Matched '/session/7AFF776F-4FBA-41BC-954F-5335FD682E7F' to command name 'deleteSession' [debug] [WD Proxy] Proxying [DELETE /session/7AFF776F-4FBA-41BC-954F-5335FD682E7F] to [DELETE http://127.0.0.1:10100/session/7AFF776F-4FBA-41BC-954F-5335FD682E7F] with no body [WD Proxy] Got response with status 404: {"value":{"error":"invalid session id","message":"Session does not exist","traceback":"(\n\t0 CoreFoundation 0x00007ff8024db18a exceptionPreprocess + 242\n\t1 libobjc.A.dylib 0x00007ff80200142b objc_exception_throw + 48\n\t2 CoreFoundation 0x00007ff8025032f6 -[NSException raise] + 9\n\t3 WebDriverAgentLib 0x000000010905d016 -[FBRoute raiseNoSessionException] + 86\n\t4 WebDriverAgentLib 0x000000010905cf63 -[FBRoute decorateRequest:] + 259\n\t5 WebDriverAgentLib 0x000000010905c39a -[FBRoute_TargetAction mountRequest:intoResponse:] + 90\n\t6 WebDriverAgentLib 0x0000000109055aa8 37-[FBWebServer registerRouteHandlers:]_block_invoke + 776\n\t7 WebDriverAgentLib 0x000000010904f19d -[RoutingHTTPServer handleRoute:withRequest:response:] + 189\n\t8 WebDriverAgentLib 0x000000010904fee1 72-[RoutingHTTPServer routeMethod:withPat... [debug] [W3C] Matched W3C error code 'invalid session id' to NoSuchDriverError [WebDriverAgentMac] Mac2Driver session cannot be deleted. Original error: Session does not exist [debug] [AppiumDriver@2e2e] Event 'quitSessionFinished' logged at 1701914495663 (10:01:35 GMT+0800 (China Standard Time)) [debug] [AppiumDriver@2e2e] Received response: null [debug] [AppiumDriver@2e2e] But deleting session, so not returning [debug] [AppiumDriver@2e2e] Responding to client with driver.deleteSession() result: null [HTTP] <-- DELETE /session/ef8258e1-1863-4856-b6f5-28d1d280d6b8 200 8 ms - 14 [HTTP] 

mykola-mokhnach commented 6 months ago

[debug] �[38;5;16m[AppiumDriver@2e2e]�[0m Responding to client with driver.getSessions() result: [{"id":"3a22204e-c801-49f0-bfa3-335b71038c2b","capabilities":{"platformName":"mac","automationName":"Mac2","bundleId":"us.zoom.xos","deviceName":"10.100.89.17","newCommandTimeout":3600,"noReset":true}},{"id":"8bee5faf-c224-4edf-9607-3f040a5269ab","capabilities":{"platformName":"mac","automationName":"Mac2","bundleId":"us.zoom.xos","deviceName":"10.100.89.17","newCommandTimeout":3600,"noReset":true}},{"id":"227210b3-e145-464b-a060-dfa45d4fadea","capabilities":{"platformName":"mac","automationName":"Mac2","bundleId":"us.zoom.xos","deviceName":"10.100.89.17","newCommandTimeout":3600,"noReset":true}},{"id":"725f0a91-c6f3-4c31-be24-b7130e51b80f","capabilities":{"platformName":"mac","automationName":"Mac2","bundleId":"us.zoom.xos","deviceName":"10.100.89.17","newCommandTimeout":3600,"noReset":true}},{"id":"62fa0dbf-97a4-47dd-9862-43ce743920c2","capabilities":{"platformName":"mac","automationName":"Mac2","bundleId":"us.zoom.xos","deviceName":"10.100.89.17","newCommandTimeout":3600,"noReset":true}},{"id":"ef8258e1...

Are you sure the sessions management works properly in your client framework? It looks like multiple sessions are being executed on the same device, although only one session must be run at the same time.

pppppino commented 6 months ago

I don't know why so many sessions in my device, I just run driver = webdriver.Remote(terminal, cap) once. In addition, I use selenium grid to manage several devices, but in every single device, just one session is started by me.

pppppino commented 6 months ago

@mykola-mokhnach , I read the log of my success run, and I also found several sessions on the same device. so I guess, is this appium design for some reasons?


[debug] [AppiumDriver@6950] Calling AppiumDriver.getSessions() with args: [] [debug] [AppiumDriver@6950] Responding to client with driver.getSessions() result: [{"id":"856f62d1-f474-4778-b80e-e663573b84fe","capabilities":{"platformName":"mac","automationName":"Mac2","bundleId":"us.zoom.xos","deviceName":"10.100.89.13","newCommandTimeout":3610,"noReset":true}},{"id":"50713a32-258c-466f-a6ca-d055bbd8231d","capabilities":{"platformName":"mac","automationName":"Mac2","bundleId":"us.zoom.xos","deviceName":"10.100.89.13","newCommandTimeout":3610,"noReset":true}},{"id":"89e59e75-7829-4aa6-97dd-c562a2b5e764","capabilities":{"platformName":"mac","automationName":"Mac2","bundleId":"us.zoom.xos","deviceName":"10.100.89.13","newCommandTimeout":3610,"noReset":true}},{"id":"72ed089e-d9ce-4032-9d8c-1f5a9770b7ba","capabilities":{"platformName":"mac","automationName":"Mac2","bundleId":"us.zoom.xos","deviceName":"10.100.89.13","newCommandTimeout":3610,"noReset":true}},{"id":"3dc79725-24d4-41ec-9b65-7a09d48dce92","capabilities":{"platformName":"mac","automationName":"Mac2","bundleId":"us.zoom.xos","deviceName":"10.100.89.13","newCommandTimeout":3610,"noReset":true}},{"id":"7e0ef1a4... [HTTP] <-- GET /sessions 200 2 ms - 1218 [HTTP]  [HTTP] --> GET /sessions [HTTP] {} [debug] [AppiumDriver@6950] Calling AppiumDriver.getSessions() with args: [] [debug] [AppiumDriver@6950] Responding to client with driver.getSessions() result: [{"id":"856f62d1-f474-4778-b80e-e663573b84fe","capabilities":{"platformName":"mac","automationName":"Mac2","bundleId":"us.zoom.xos","deviceName":"10.100.89.13","newCommandTimeout":3610,"noReset":true}},{"id":"50713a32-258c-466f-a6ca-d055bbd8231d","capabilities":{"platformName":"mac","automationName":"Mac2","bundleId":"us.zoom.xos","deviceName":"10.100.89.13","newCommandTimeout":3610,"noReset":true}},{"id":"89e59e75-7829-4aa6-97dd-c562a2b5e764","capabilities":{"platformName":"mac","automationName":"Mac2","bundleId":"us.zoom.xos","deviceName":"10.100.89.13","newCommandTimeout":3610,"noReset":true}},{"id":"72ed089e-d9ce-4032-9d8c-1f5a9770b7ba","capabilities":{"platformName":"mac","automationName":"Mac2","bundleId":"us.zoom.xos","deviceName":"10.100.89.13","newCommandTimeout":3610,"noReset":true}},{"id":"3dc79725-24d4-41ec-9b65-7a09d48dce92","capabilities":{"platformName":"mac","automationName":"Mac2","bundleId":"us.zoom.xos","deviceName":"10.100.89.13","newCommandTimeout":3610,"noReset":true}},{"id":"7e0ef1a4... [HTTP] <-- GET /sessions 304 3 ms - -

mykola-mokhnach commented 6 months ago

this appium design

not sure what you mean. It just runs whatever is requested by the client and should work like that. If you use hub then make sure it mediates session creation requests to appropriate nodes.