Skip to content

Instantly share code, notes, and snippets.

@KazuCocoa
Created January 7, 2020 11:58
Show Gist options
  • Save KazuCocoa/0a11d29a62844a579fe2c92f95170e2d to your computer and use it in GitHub Desktop.
Save KazuCocoa/0a11d29a62844a579fe2c92f95170e2d to your computer and use it in GitHub Desktop.
client
require 'appium_lib_core'
core = Appium::Core.for(desired_capabilities: {automationName: 'mac', platformName: 'mac', 'deviceName': 'Mac', a4mHost: 'localhost', a4mPort: 50369, a4mAppPath: '/Applications/AppiumForMac.app'})
driver1 = core.start_driver
core = Appium::Core.for(desired_capabilities: {automationName: 'mac', platformName: 'mac', 'deviceName': 'Mac', a4mHost: 'localhost', a4mPort: 50370, a4mAppPath: '/Applications/AppiumForMac2.app'})
driver2 = core.start_driver
driver1.quit
driver2.quit
---
Appium server
[Appium] Welcome to Appium v1.16.0-beta.3 (REV 39823401b18efb2d794db6f59a54ac4188249222)
[Appium] Appium REST http interface listener started on 0.0.0.0:4723
[HTTP] --> POST /wd/hub/session
[HTTP] {"desiredCapabilities":{"automationName":"mac","platformName":"mac","deviceName":"Mac","a4mHost":"localhost","a4mPort":50369,"a4mAppPath":"/Applications/AppiumForMac.app"},"capabilities":{"firstMatch":[{"appium:automationName":"mac","platformName":"mac","appium:deviceName":"Mac","appium:a4mHost":"localhost","appium:a4mPort":50369,"appium:a4mAppPath":"/Applications/AppiumForMac.app"}]}}
[debug] [W3C] Calling AppiumDriver.createSession() with args: [{"automationName":"mac","platformName":"mac","deviceName":"Mac","a4mHost":"localhost","a4mPort":50369,"a4mAppPath":"/Applications/AppiumForMac.app"},null,{"firstMatch":[{"appium:automationName":"mac","platformName":"mac","appium:deviceName":"Mac","appium:a4mHost":"localhost","appium:a4mPort":50369,"appium:a4mAppPath":"/Applications/AppiumForMac.app"}]}]
[debug] [BaseDriver] Event 'newSessionRequested' logged at 1578398167848 (20:56:07 GMT+0900 (Japan Standard Time))
[Appium] Appium v1.16.0-beta.3 creating new MacDriver (v1.8.0) session
[debug] [BaseDriver] W3C capabilities and MJSONWP desired capabilities were provided
[debug] [BaseDriver] Creating session with W3C capabilities: {
[debug] [BaseDriver] "alwaysMatch": {
[debug] [BaseDriver] "platformName": "mac",
[debug] [BaseDriver] "appium:automationName": "mac",
[debug] [BaseDriver] "appium:deviceName": "Mac",
[debug] [BaseDriver] "appium:a4mHost": "localhost",
[debug] [BaseDriver] "appium:a4mPort": 50369,
[debug] [BaseDriver] "appium:a4mAppPath": "/Applications/AppiumForMac.app"
[debug] [BaseDriver] },
[debug] [BaseDriver] "firstMatch": [
[debug] [BaseDriver] {}
[debug] [BaseDriver] ]
[debug] [BaseDriver] }
[BaseDriver] Session created with session id: f604d1a3-c807-4e84-91db-d4833f7d5432
[MacDriver] Killing any old AppiumForMac
[MacDriver] Successfully cleaned up old Appium4Mac servers
[MacDriver] Spawning AppiumForMac with: /Applications/AppiumForMac.app
[Appium4Mac] [STDERR] 2020-01-07 20:56:08:560 AppiumForMac[40889:307] HTTPServer: Started HTTP server on port 50369
[debug] [WD Proxy] Matched '/session' to command name 'createSession'
[debug] [WD Proxy] Proxying [POST /session] to [POST http://localhost:50369/wd/hub/session] with body: {"desiredCapabilities":{"platformName":"mac","automationName":"mac","deviceName":"Mac","a4mHost":"localhost","a4mPort":50369,"a4mAppPath":"/Applications/AppiumForMac.app"}}
[debug] [WD Proxy] Got response with status 200: {"status":0,"sessionId":"rr5rHAyj","value":{"locationContextEnabled":false,"webStorageEnabled":false,"browserName":"Mac","platform":"Mac","databaseEnabled":false,"version":"10.14.6","javascriptEnabled":true,"takesScreenshot":true,"nativeEvents":true}}
[WD Proxy] Determined the downstream protocol as 'MJSONWP'
[Appium] New MacDriver session created successfully, session f604d1a3-c807-4e84-91db-d4833f7d5432 added to master session list
[debug] [BaseDriver] Event 'newSessionStarted' logged at 1578398168865 (20:56:08 GMT+0900 (Japan Standard Time))
[debug] [W3C (f604d1a3)] Cached the protocol value 'W3C' for the new session f604d1a3-c807-4e84-91db-d4833f7d5432
[debug] [W3C (f604d1a3)] Responding to client with driver.createSession() result: {"capabilities":{"platformName":"mac","automationName":"mac","deviceName":"Mac","a4mHost":"localhost","a4mPort":50369,"a4mAppPath":"/Applications/AppiumForMac.app"}}
[HTTP] <-- POST /wd/hub/session 200 1023 ms - 226
[HTTP]
[HTTP] --> POST /wd/hub/session/f604d1a3-c807-4e84-91db-d4833f7d5432/timeouts
[HTTP] {"implicit":0}
[W3C (f604d1a3)] Driver proxy active, passing request on via HTTP proxy
[debug] [WD Proxy] Matched '/wd/hub/session/f604d1a3-c807-4e84-91db-d4833f7d5432/timeouts' to command name 'timeouts'
[debug] [Protocol Converter] Will send the following request bodies to /timeouts: [{"type":"implicit","ms":0}]
[debug] [WD Proxy] Proxying [POST /wd/hub/session/f604d1a3-c807-4e84-91db-d4833f7d5432/timeouts] to [POST http://localhost:50369/wd/hub/session/rr5rHAyj/timeouts] with body: {"type":"implicit","ms":0}
[debug] [WD Proxy] Got response with status 200: {"status":0,"sessionId":"rr5rHAyj","value":"0"}
[WD Proxy] Replacing sessionId rr5rHAyj with f604d1a3-c807-4e84-91db-d4833f7d5432
[HTTP] <-- POST /wd/hub/session/f604d1a3-c807-4e84-91db-d4833f7d5432/timeouts 200 10 ms - 75
[HTTP]
[HTTP] --> POST /wd/hub/session
[HTTP] {"desiredCapabilities":{"automationName":"mac","platformName":"mac","deviceName":"Mac","a4mHost":"localhost","a4mPort":50370,"a4mAppPath":"/Applications/AppiumForMac2.app"},"capabilities":{"firstMatch":[{"appium:automationName":"mac","platformName":"mac","appium:deviceName":"Mac","appium:a4mHost":"localhost","appium:a4mPort":50370,"appium:a4mAppPath":"/Applications/AppiumForMac2.app"}]}}
[debug] [W3C] Calling AppiumDriver.createSession() with args: [{"automationName":"mac","platformName":"mac","deviceName":"Mac","a4mHost":"localhost","a4mPort":50370,"a4mAppPath":"/Applications/AppiumForMac2.app"},null,{"firstMatch":[{"appium:automationName":"mac","platformName":"mac","appium:deviceName":"Mac","appium:a4mHost":"localhost","appium:a4mPort":50370,"appium:a4mAppPath":"/Applications/AppiumForMac2.app"}]}]
[debug] [BaseDriver] Event 'newSessionRequested' logged at 1578398168885 (20:56:08 GMT+0900 (Japan Standard Time))
[Appium] Appium v1.16.0-beta.3 creating new MacDriver (v1.8.0) session
[debug] [BaseDriver] W3C capabilities and MJSONWP desired capabilities were provided
[debug] [BaseDriver] Creating session with W3C capabilities: {
[debug] [BaseDriver] "alwaysMatch": {
[debug] [BaseDriver] "platformName": "mac",
[debug] [BaseDriver] "appium:automationName": "mac",
[debug] [BaseDriver] "appium:deviceName": "Mac",
[debug] [BaseDriver] "appium:a4mHost": "localhost",
[debug] [BaseDriver] "appium:a4mPort": 50370,
[debug] [BaseDriver] "appium:a4mAppPath": "/Applications/AppiumForMac2.app"
[debug] [BaseDriver] },
[debug] [BaseDriver] "firstMatch": [
[debug] [BaseDriver] {}
[debug] [BaseDriver] ]
[debug] [BaseDriver] }
[BaseDriver] Session created with session id: dc8195e9-13e5-4969-b05f-d50eb9bd545b
[MacDriver] Killing any old AppiumForMac
[MacDriver] Successfully cleaned up old Appium4Mac servers
[MacDriver] Spawning AppiumForMac with: /Applications/AppiumForMac2.app
[MacDriver] AppiumForMac exited unexpectedly with code null, signal SIGTERM
[Appium4Mac] [STDERR] 2020-01-07 20:56:09:123 AppiumForMac[40894:307] HTTPServer: Started HTTP server on port 50370
[debug] [WD Proxy] Matched '/session' to command name 'createSession'
[debug] [WD Proxy] Proxying [POST /session] to [POST http://localhost:50370/wd/hub/session] with body: {"desiredCapabilities":{"platformName":"mac","automationName":"mac","deviceName":"Mac","a4mHost":"localhost","a4mPort":50370,"a4mAppPath":"/Applications/AppiumForMac2.app"}}
[debug] [WD Proxy] Got response with status 200: {"status":0,"sessionId":"RVrPioMQ","value":{"locationContextEnabled":false,"webStorageEnabled":false,"browserName":"Mac","platform":"Mac","databaseEnabled":false,"version":"10.14.6","javascriptEnabled":true,"takesScreenshot":true,"nativeEvents":true}}
[WD Proxy] Determined the downstream protocol as 'MJSONWP'
[Appium] New MacDriver session created successfully, session dc8195e9-13e5-4969-b05f-d50eb9bd545b added to master session list
[debug] [BaseDriver] Event 'newSessionStarted' logged at 1578398169373 (20:56:09 GMT+0900 (Japan Standard Time))
[debug] [W3C (dc8195e9)] Cached the protocol value 'W3C' for the new session dc8195e9-13e5-4969-b05f-d50eb9bd545b
[debug] [W3C (dc8195e9)] Responding to client with driver.createSession() result: {"capabilities":{"platformName":"mac","automationName":"mac","deviceName":"Mac","a4mHost":"localhost","a4mPort":50370,"a4mAppPath":"/Applications/AppiumForMac2.app"}}
[HTTP] <-- POST /wd/hub/session 200 489 ms - 227
[HTTP]
[HTTP] --> POST /wd/hub/session/dc8195e9-13e5-4969-b05f-d50eb9bd545b/timeouts
[HTTP] {"implicit":0}
[W3C (dc8195e9)] Driver proxy active, passing request on via HTTP proxy
[debug] [WD Proxy] Matched '/wd/hub/session/dc8195e9-13e5-4969-b05f-d50eb9bd545b/timeouts' to command name 'timeouts'
[debug] [Protocol Converter] Will send the following request bodies to /timeouts: [{"type":"implicit","ms":0}]
[debug] [WD Proxy] Proxying [POST /wd/hub/session/dc8195e9-13e5-4969-b05f-d50eb9bd545b/timeouts] to [POST http://localhost:50370/wd/hub/session/RVrPioMQ/timeouts] with body: {"type":"implicit","ms":0}
[debug] [WD Proxy] Got response with status 200: {"status":0,"sessionId":"RVrPioMQ","value":"0"}
[WD Proxy] Replacing sessionId RVrPioMQ with dc8195e9-13e5-4969-b05f-d50eb9bd545b
[HTTP] <-- POST /wd/hub/session/dc8195e9-13e5-4969-b05f-d50eb9bd545b/timeouts 200 4 ms - 75
[HTTP]
[HTTP] --> DELETE /wd/hub/session/f604d1a3-c807-4e84-91db-d4833f7d5432
[HTTP] {}
[debug] [W3C (f604d1a3)] Calling AppiumDriver.deleteSession() with args: ["f604d1a3-c807-4e84-91db-d4833f7d5432"]
[debug] [BaseDriver] Event 'quitSessionRequested' logged at 1578398169379 (20:56:09 GMT+0900 (Japan Standard Time))
[Appium] Removing session f604d1a3-c807-4e84-91db-d4833f7d5432 from our master session list
[debug] [MacDriver] Deleting AppiumForMac session
[debug] [MacDriver] Deleting AppiumForMac server session
[debug] [WD Proxy] Matched '/' to command name 'deleteSession'
[debug] [WD Proxy] Proxying [DELETE /] to [DELETE http://localhost:50369/wd/hub/session/rr5rHAyj] with no body
[WD Proxy] Got an unexpected response with status undefined: {"errno":"ECONNREFUSED","code":"ECONNREFUSED","syscall":"connect","address":"127.0.0.1","port":50369}
[MacDriver] Did not get confirmation AppiumForMac deleteSession worked; Error was: UnknownError: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to remote server. Original error: Error: connect ECONNREFUSED 127.0.0.1:50369
[MacDriver] Error: Can't stop process; it's not currently running (cmd: '/Applications/AppiumForMac.app/Contents/MacOS/AppiumForMac')
[MacDriver] at SubProcess.stop (/Users/kazu/GitHub/appium-mac-driver/node_modules/teen_process/lib/subprocess.js:221:13)
[MacDriver] at AppiumForMac.stop (/Users/kazu/GitHub/appium-mac-driver/lib/appium-for-mac.js:101:25)
[MacDriver] at MacDriver.stop [as deleteSession] (/Users/kazu/GitHub/appium-mac-driver/lib/driver.js:61:28)
[debug] [BaseDriver] Event 'quitSessionFinished' logged at 1578398169398 (20:56:09 GMT+0900 (Japan Standard Time))
[debug] [W3C (f604d1a3)] Received response: null
[debug] [W3C (f604d1a3)] But deleting session, so not returning
[debug] [W3C (f604d1a3)] Responding to client with driver.deleteSession() result: null
[HTTP] <-- DELETE /wd/hub/session/f604d1a3-c807-4e84-91db-d4833f7d5432 200 20 ms - 14
[HTTP]
[HTTP] --> DELETE /wd/hub/session/dc8195e9-13e5-4969-b05f-d50eb9bd545b
[HTTP] {}
[debug] [W3C (dc8195e9)] Calling AppiumDriver.deleteSession() with args: ["dc8195e9-13e5-4969-b05f-d50eb9bd545b"]
[debug] [BaseDriver] Event 'quitSessionRequested' logged at 1578398169400 (20:56:09 GMT+0900 (Japan Standard Time))
[Appium] Removing session dc8195e9-13e5-4969-b05f-d50eb9bd545b from our master session list
[debug] [MacDriver] Deleting AppiumForMac session
[debug] [MacDriver] Deleting AppiumForMac server session
[debug] [WD Proxy] Matched '/' to command name 'deleteSession'
[debug] [WD Proxy] Proxying [DELETE /] to [DELETE http://localhost:50370/wd/hub/session/RVrPioMQ] with no body
[debug] [WD Proxy] Got response with status 200: {
[debug] [WD Proxy] "status" : 0,
[debug] [WD Proxy] "sessionId" : "RVrPioMQ"
[debug] [WD Proxy] }
[MacDriver] AppiumForMac exited unexpectedly with code null, signal SIGTERM
[debug] [BaseDriver] Event 'quitSessionFinished' logged at 1578398169431 (20:56:09 GMT+0900 (Japan Standard Time))
[debug] [W3C (dc8195e9)] Received response: null
[debug] [W3C (dc8195e9)] But deleting session, so not returning
[debug] [W3C (dc8195e9)] Responding to client with driver.deleteSession() result: null
[HTTP] <-- DELETE /wd/hub/session/dc8195e9-13e5-4969-b05f-d50eb9bd545b 200 32 ms - 14
[HTTP]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment