appium / appium-inspector

A GUI inspector for mobile apps and more, powered by a (separately installed) Appium server
https://appium.github.io/appium-inspector/
Other
1.17k stars 288 forks source link

Not connecting to appium grid using appium inspector - showing unknown device or udid #637

Closed krishtoautomate closed 2 years ago

krishtoautomate commented 2 years ago

Not connecting to appium grid using appium inspector - showing udid not found.

Same connection with same capabilities working fine with code in IDE or jenkins.

krishtoautomate commented 2 years ago
image
KazuCocoa commented 2 years ago

Could you share the full appium server log?

krishtoautomate commented 2 years ago

I think its not reaching Appium server and it is failing to create a session with grid itself. Is their anyway to check logs of inspector?

KazuCocoa commented 2 years ago

You can see the request itself via the web inspector. (available right click -> inspect element as same as general web browser's inspect element in chromium)

krishtoautomate commented 2 years ago

Connects 1 in 10 times to same device without modifying any settings

KazuCocoa commented 2 years ago

So, appium-inspector sent the same capabilities, but the grid replied back to the error, correct? (Not this inspector's issue, or not)

krishtoautomate commented 2 years ago
image
krishtoautomate commented 2 years ago
image
krishtoautomate commented 2 years ago

{"value":{"error":"unknown error","message":"An unknown server-side error occurred while processing the command. Original error: Unknown device or simulator UDID: '00008110-000C341826B9401E'","stacktrace":"UnknownError: An unknown server-side error occurred while processing the command. Original error: Unknown device or simulator UDID: '00008110-000C341826B9401E'\n at getResponseForW3CError (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/protocol/errors.js:804:9)\n at asyncHandler (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/protocol/protocol.js:380:37)"}}

krishtoautomate commented 2 years ago

retrying multiple times connects without making any changes :

image
krishtoautomate commented 2 years ago

So, appium-inspector sent the same capabilities, but the grid replied back to the error, correct? (Not this inspector's issue, or not)

seeing this issue with appium inspector only and not with java code

KazuCocoa commented 2 years ago

What Java client did you use? v8? appium-inspecotor itself depends on webdriverio https://github.com/webdriverio/webdriverio as the appium client, so the same issue might occur in the webdriverio as well, then.

Btw, where was the appium server running? /usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/protocol/errors.js:804:9 It means the request reached the appium server, so you may be able to get the appium server log, correct?

krishtoautomate commented 2 years ago

Request is not reaching appium server. it is failing in 1-2 seconds.

Java client: implementation 'io.appium:java-client:7.6.0'

krishtoautomate commented 2 years ago

failing to handshake with grid itself i guess.

KazuCocoa commented 2 years ago

Sorry, I'm confused. The stacktrace in your attached error message indicated the error was by /usr/local/lib/node_modules/appium. It is an appium server installed in somewhere, not selenium grid. Then, the appium server may have logs (which may tell more clear reason)

{"value":{"error":"unknown error","message":"An unknown server-side error occurred while processing the command. Original error: Unknown device or simulator UDID: '00008110-000C341826B9401E'","stacktrace":"UnknownError: An unknown server-side error occurred while processing the command. Original error: Unknown device or simulator UDID: '00008110-000C341826B9401E'\n at getResponseForW3CError (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/protocol/errors.js:804:9)\n at asyncHandler (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/protocol/protocol.js:380:37)"}}

krishtoautomate commented 2 years ago

im confused as well with the error. may be it is trying to hit my local appium-base-driver or grid machine appium-base-driver.

I checked the logs and It is not reaching my node appium for sure.

KazuCocoa commented 2 years ago

then, could you share the appium server log when you run the Java client code as GIST?

krishtoautomate commented 2 years ago

Calling AppiumDriver.getStatus() with args: [] [debug] [GENERIC] Responding to client with driver.getStatus() result: {"build":{"version":"1.22.3"}} [HTTP] <-- GET /wd/hub/status 200 1 ms - 68 [HTTP] [debug] [HTTP] Request idempotency key: b4fb083e-8f25-4d94-acdb-ce6fe38490b1 [HTTP] --> POST /wd/hub/session [HTTP] {"desiredCapabilities":{"server:CONFIG_UUID":"34659b82-a16d-4e43-a1ca-0d67a5fdff6a","noReset":false,"bundleId":"com.apple.TestFlight","autoDismissAlerts":true,"deviceName":"iPhone 14 Pro","fullReset":false,"wdaLocalPort":8388,"wdaStartupRetryInterval":2000,"autoLaunch":true,"newCommandTimeout":120,"platformVersion":"12.2","automationName":"XCUITest","wdaStartupRetries":2,"platformName":"ios","udid":"00008120-000E656011D3401E"},"capabilities":{"firstMatch":[{"platformName":"ios","server:CONFIG_UUID":"34659b82-a16d-4e43-a1ca-0d67a5fdff6a"}]}} [debug] [W3C] Calling AppiumDriver.createSession() with args: [{"server:CONFIG_UUID":"34659b82-a16d-4e43-a1ca-0d67a5fdff6a","noReset":false,"bundleId":"com.apple.TestFlight","autoDismissAlerts":true,"deviceName":"iPhone 14 Pro","fullReset":false,"wdaLocalPort":8388,"wdaStartupRetryInterval":2000,"autoLaunch":true,"newCommandTimeout":120,"platformVersion":"12.2","automationName":"XCUITest","wdaStartupRetries":2,"platformName":"ios","udid":"00008120-000E656011D3401E"},null,{"firstMatch":[{"platformName":"ios","server:CONFIG_UUID":"34659b82-a16d-4e43-a1ca-0d67a5fdff6a"}]}] [debug] [BaseDriver] Event 'newSessionRequested' logged at 1666063517865 (23:25:17 GMT-0400 (Eastern Daylight Time)) [BaseDriver] The following capabilities are not standard capabilities and should have an extension prefix: [BaseDriver] udid [BaseDriver] automationName [Appium] The following capabilities were provided in the JSONWP desired capabilities that are missing in W3C capabilities: ["noReset","bundleId","autoDismissAlerts","deviceName","fullReset","wdaLocalPort","wdaStartupRetryInterval","autoLaunch","newCommandTimeout","platformVersion","wdaStartupRetries"] [Appium] Trying to fix W3C capabilities by merging them with JSONWP caps [BaseDriver] The following capabilities are not standard capabilities and should have an extension prefix: [BaseDriver] noReset [BaseDriver] bundleId [BaseDriver] autoDismissAlerts [BaseDriver] deviceName [BaseDriver] fullReset [BaseDriver] wdaLocalPort [BaseDriver] wdaStartupRetryInterval [BaseDriver] autoLaunch [BaseDriver] newCommandTimeout [BaseDriver] platformVersion [BaseDriver] wdaStartupRetries [BaseDriver] udid [BaseDriver] automationName [Appium] Appium v1.22.3 creating new XCUITestDriver (v3.59.0) session [debug] [BaseDriver] W3C capabilities and MJSONWP desired capabilities were provided [debug] [BaseDriver] Creating session with W3C capabilities: { [debug] [BaseDriver] "alwaysMatch": { [debug] [BaseDriver] "appium:noReset": false, [debug] [BaseDriver] "appium:bundleId": "com.apple.TestFlight", [debug] [BaseDriver] "appium:autoDismissAlerts": true, [debug] [BaseDriver] "appium:deviceName": "iPhone 14 Pro", [debug] [BaseDriver] "appium:fullReset": false, [debug] [BaseDriver] "appium:wdaLocalPort": 8388, [debug] [BaseDriver] "appium:wdaStartupRetryInterval": 2000, [debug] [BaseDriver] "appium:autoLaunch": true, [debug] [BaseDriver] "appium:newCommandTimeout": 120, [debug] [BaseDriver] "appium:platformVersion": "12.2", [debug] [BaseDriver] "appium:wdaStartupRetries": 2, [debug] [BaseDriver] "platformName": "ios", [debug] [BaseDriver] "server:CONFIG_UUID": "34659b82-a16d-4e43-a1ca-0d67a5fdff6a", [debug] [BaseDriver] "appium:udid": "00008120-000E656011D3401E", [debug] [BaseDriver] "appium:automationName": "XCUITest" [debug] [BaseDriver] }, [debug] [BaseDriver] "firstMatch": [ [debug] [BaseDriver] {} [debug] [BaseDriver] ] [debug] [BaseDriver] } [BaseDriver] The following capabilities were provided, but are not recognized by Appium: [BaseDriver] server:CONFIG_UUID [BaseDriver] Session created with session id: 5241fd69-7b72-4fec-80d3-d40b2a8b5cb2 [debug] [XCUITest] Current user: 'krish' [debug] [XCUITest] Available devices: 00008120-000E656011D3401E, 00008110-000C341826B9401E, 00008110-001155D23E38401E, 00008030-001C38593420402E [debug] [XCUITest] Creating iDevice object with udid '00008120-000E656011D3401E' [XCUITest] Determining device to run tests on: udid: '00008120-000E656011D3401E', real device: true [debug] [BaseDriver] Event 'xcodeDetailsRetrieved' logged at 1666063517908 (23:25:17 GMT-0400 (Eastern Daylight Time)) [debug] [BaseDriver] Event 'appConfigured' logged at 1666063517908 (23:25:17 GMT-0400 (Eastern Daylight Time)) [debug] [BaseDriver] Event 'resetStarted' logged at 1666063517908 (23:25:17 GMT-0400 (Eastern Daylight Time)) [debug] [XCUITest] Reset: running ios real device reset flow [debug] [BaseDriver] Event 'resetComplete' logged at 1666063517909 (23:25:17 GMT-0400 (Eastern Daylight Time)) [WebDriverAgent] Using WDA path: '/usr/local/lib/node_modules/appium/node_modules/appium-webdriveragent' [WebDriverAgent] Using WDA agent: '/usr/local/lib/node_modules/appium/node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj' [debug] [XCUITest] Crash reports root '/Users/krish/Library/Logs/CrashReporter/MobileDevice/iPhone 14 Pro' does not exist. Got nothing to gather. [debug] [BaseDriver] Event 'logCaptureStarted' logged at 1666063518102 (23:25:18 GMT-0400 (Eastern Daylight Time)) [XCUITest] Setting up real device [debug] [WebDriverAgent] No obsolete cached processes from previous WDA sessions listening on port 8388 have been found [DevCon Factory] Requesting connection for device 00008120-000E656011D3401E on local port 8388, device port 8388 [debug] [DevCon Factory] Cached connections count: 0 [DevCon Factory] Successfully requested the connection for 00008120-000E656011D3401E:8388 [debug] [XCUITest] Starting WebDriverAgent initialization with the synchronization key 'XCUITestDriver' [debug] [WD Proxy] Matched '/status' to command name 'getStatus' [debug] [WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8388/status] with no body [debug] [WD Proxy] Got response with status 200: {"value":{"message":"WebDriverAgent is ready to accept commands","state":"success","os":{"testmanagerdVersion":28,"name":"iOS","sdkVersion":"16.0","version":"16.0.3"},"ios":{"ip":"169.254.236.138"},"ready":true,"build":{"upgradedAt":"1665468539000","time":"Oct 11 2022 14:32:48","productBundleIdentifier":"com.facebook.WebDriverAgentRunner"}},"sessionId":null} [debug] [WebDriverAgent] Upgrade timestamp of the currently bundled WDA: 1665468539000 [debug] [WebDriverAgent] Upgrade timestamp of the WDA on the device: 1665468539000 [WebDriverAgent] Will reuse previously cached WDA instance at 'http://127.0.0.1:8388/' with 'com.facebook.WebDriverAgentRunner'. Set the wdaLocalPort capability to a value different from 8388 if this is an undesired behavior. [debug] [XCUITest] Trying to start WebDriverAgent 2 times with 2000ms interval [debug] [BaseDriver] Event 'wdaStartAttempted' logged at 1666063518376 (23:25:18 GMT-0400 (Eastern Daylight Time)) [WebDriverAgent] Using provided WebdriverAgent at 'http://127.0.0.1:8388/' [debug] [WD Proxy] Matched '/status' to command name 'getStatus' [debug] [WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8388/status] with no body [debug] [WD Proxy] Got response with status 200: {"value":{"message":"WebDriverAgent is ready to accept commands","state":"success","os":{"testmanagerdVersion":28,"name":"iOS","sdkVersion":"16.0","version":"16.0.3"},"ios":{"ip":"169.254.236.138"},"ready":true,"build":{"upgradedAt":"1665468539000","time":"Oct 11 2022 14:32:48","productBundleIdentifier":"com.facebook.WebDriverAgentRunner"}},"sessionId":null} [debug] [BaseDriver] Event 'wdaSessionAttempted' logged at 1666063518386 (23:25:18 GMT-0400 (Eastern 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://127.0.0.1:8388/session] with body: {"capabilities":{"firstMatch":[{"bundleId":"com.apple.TestFlight","arguments":[],"environment":{},"eventloopIdleDelaySec":0,"shouldWaitForQuiescence":true,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true,"shouldTerminateApp":true,"forceAppLaunch":true,"useNativeCachingStrategy":true,"forceSimulatorSoftwareKeyboardPresence":true,"defaultAlertAction":"dismiss"}],"alwaysMatch":{}}} [debug] [WD Proxy] Got response with status 200: {"value":{"sessionId":"DBE13CF8-908E-459C-AACE-89BF9DE20C02","capabilities":{"device":"iphone","browserName":"TestFlight","sdkVersion":"16.0.3","CFBundleIdentifier":"com.apple.TestFlight"}},"sessionId":"DBE13CF8-908E-459C-AACE-89BF9DE20C02"} [WD Proxy] Determined the downstream protocol as 'W3C' [debug] [BaseDriver] Event 'wdaSessionStarted' logged at 1666063519667 (23:25:19 GMT-0400 (Eastern Daylight Time)) [debug] [BaseDriver] Event 'wdaStarted' logged at 1666063519668 (23:25:19 GMT-0400 (Eastern 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 1666063519669 (23:25:19 GMT-0400 (Eastern Daylight Time)) [debug] [BaseDriver] The value of 'elementResponseAttributes' setting did not change. Skipping the update for it [debug] [BaseDriver] The value of 'shouldUseCompactResponses' setting did not change. Skipping the update for it [Appium] New XCUITestDriver session created successfully, session 5241fd69-7b72-4fec-80d3-d40b2a8b5cb2 added to master session list [debug] [BaseDriver] Event 'newSessionStarted' logged at 1666063519673 (23:25:19 GMT-0400 (Eastern Daylight Time)) [debug] [W3C (5241fd69)] Cached the protocol value 'W3C' for the new session 5241fd69-7b72-4fec-80d3-d40b2a8b5cb2 [debug] [W3C (5241fd69)] 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","server:CONFIG_UUID":"34659b82-a16d-4e43-a1ca-0d67a5fdff6a","noReset":false,"bundleId":"com.apple.TestFlight","autoDismissAlerts":true,"deviceName":"iPhone 14 Pro","fullReset":false,"wdaLocalPort":8388,"wdaStartupRetryInterval":2000,"autoLaunch":true,"newCommandTimeout":120,"platformVersion":"12.2","wdaStartupRetries":2,"udid":"00008120-000E656011D3401E","automationName":"XCUITest"}} [HTTP] <-- POST /wd/hub/session 200 1810 ms - 681 [HTTP] [HTTP] --> POST /wd/hub/session/5241fd69-7b72-4fec-80d3-d40b2a8b5cb2/timeouts [HTTP] {"implicit":5000} [debug] [W3C (5241fd69)] Calling AppiumDriver.timeouts() with args: [null,null,null,null,5000,"5241fd69-7b72-4fec-80d3-d40b2a8b5cb2"] [debug] [XCUITest] Executing command 'timeouts' [debug] [BaseDriver] W3C timeout argument: {"implicit":5000}} [debug] [BaseDriver] Set implicit wait to 5000ms [debug] [W3C (5241fd69)] Responding to client with driver.timeouts() result: null [HTTP] <-- POST /wd/hub/session/5241fd69-7b72-4fec-80d3-d40b2a8b5cb2/timeouts 200 2 ms - 14 [HTTP] [HTTP] --> GET /wd/hub/session/5241fd69-7b72-4fec-80d3-d40b2a8b5cb2/alert/text [HTTP] {} [debug] [W3C (5241fd69)] Calling AppiumDriver.getAlertText() with args: ["5241fd69-7b72-4fec-80d3-d40b2a8b5cb2"] [debug] [XCUITest] Executing command 'getAlertText' [debug] [WD Proxy] Matched '/alert/text' to command name 'getAlertText' [debug] [WD Proxy] Proxying [GET /alert/text] to [GET http://127.0.0.1:8388/session/DBE13CF8-908E-459C-AACE-89BF9DE20C02/alert/text] with no body [WD Proxy] Got response with status 404: {"value":{"error":"no such alert","message":"An attempt was made to operate on a modal dialog when one was not open","traceback":""},"sessionId":"DBE13CF8-908E-459C-AACE-89BF9DE20C02"} [debug] [W3C] Matched W3C error code 'no such alert' to NoSuchAlertError [debug] [W3C (5241fd69)] Encountered internal error running command: NoSuchAlertError: An attempt was made to operate on a modal dialog when one was not open [debug] [W3C (5241fd69)] at errorFromW3CJsonCode (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/protocol/errors.js:780:25) [debug] [W3C (5241fd69)] at ProxyRequestError.getActualError (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/protocol/errors.js:663:14) [debug] [W3C (5241fd69)] at JWProxy.command (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/jsonwp-proxy/proxy.js:272:19) [debug] [W3C (5241fd69)] at runMicrotasks () [debug] [W3C (5241fd69)] at processTicksAndRejections (internal/process/task_queues.js:95:5) [debug] [W3C (5241fd69)] at XCUITestDriver.proxyCommand (/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/lib/commands/proxy-helper.js:96:12) [debug] [W3C (5241fd69)] at XCUITestDriver.getAlertText (/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/lib/commands/alert.js:12:10) [HTTP] <-- GET /wd/hub/session/5241fd69-7b72-4fec-80d3-d40b2a8b5cb2/alert/text 404 99 ms - 1006 [HTTP] [HTTP] --> POST /wd/hub/session/5241fd69-7b72-4fec-80d3-d40b2a8b5cb2/appium/app/reset [HTTP] {} [debug] [W3C (5241fd69)] Calling AppiumDriver.reset() with args: ["5241fd69-7b72-4fec-80d3-d40b2a8b5cb2"] [debug] [XCUITest] Executing command 'reset' [debug] [BaseDriver] Resetting app mid-session [debug] [BaseDriver] Running generic full reset [debug] [WD Proxy] Matched '/session/5241fd69-7b72-4fec-80d3-d40b2a8b5cb2' to command name 'deleteSession' [debug] [WD Proxy] Proxying [DELETE /session/5241fd69-7b72-4fec-80d3-d40b2a8b5cb2] to [DELETE http://127.0.0.1:8388/session/DBE13CF8-908E-459C-AACE-89BF9DE20C02] with no body [debug] [WD Proxy] Got response with status 200: {"value":null,"sessionId":null} [DevCon Factory] Releasing connections for 00008120-000E656011D3401E device on any port number [DevCon Factory] Found cached connections to release: ["00008120-000E656011D3401E:8388"] [DevCon Factory] Releasing the listener for '00008120-000E656011D3401E:8388' [debug] [iProxy@00008120:8388] Closing the connection [debug] [DevCon Factory] Cached connections count: 0 [debug] [XCUITest] Not clearing log files. Use clearSystemFiles capability to turn on. [debug] [BaseDriver] Restarting app [debug] [BaseDriver] Creating session with W3C capabilities: { [debug] [BaseDriver] "alwaysMatch": { [debug] [BaseDriver] "platformName": "ios", [debug] [BaseDriver] "server:CONFIG_UUID": "34659b82-a16d-4e43-a1ca-0d67a5fdff6a", [debug] [BaseDriver] "noReset": false, [debug] [BaseDriver] "bundleId": "com.apple.TestFlight", [debug] [BaseDriver] "autoDismissAlerts": true, [debug] [BaseDriver] "deviceName": "iPhone 14 Pro", [debug] [BaseDriver] "fullReset": false, [debug] [BaseDriver] "wdaLocalPort": 8388, [debug] [BaseDriver] "wdaStartupRetryInterval": 2000, [debug] [BaseDriver] "autoLaunch": true, [debug] [BaseDriver] "newCommandTimeout": 120, [debug] [BaseDriver] "platformVersion": "12.2", [debug] [BaseDriver] "wdaStartupRetries": 2, [debug] [BaseDriver] "udid": "00008120-000E656011D3401E", [debug] [BaseDriver] "automationName": "XCUITest" [debug] [BaseDriver] }, [debug] [BaseDriver] "firstMatch": [ [debug] [BaseDriver] {} [debug] [BaseDriver] ] [debug] [BaseDriver] } [BaseDriver] The following capabilities are not standard capabilities and should have an extension prefix: [BaseDriver] noReset [BaseDriver] bundleId [BaseDriver] autoDismissAlerts [BaseDriver] deviceName [BaseDriver] fullReset [BaseDriver] wdaLocalPort [BaseDriver] wdaStartupRetryInterval [BaseDriver] autoLaunch [BaseDriver] newCommandTimeout [BaseDriver] platformVersion [BaseDriver] wdaStartupRetries [BaseDriver] udid [BaseDriver] automationName [BaseDriver] The following capabilities were provided, but are not recognized by Appium: [BaseDriver] server:CONFIG_UUID [BaseDriver] Session created with session id: 670c0e54-5a46-4cde-a4d4-af2c72b5700e [debug] [XCUITest] Current user: 'krish' [debug] [XCUITest] Available devices: 00008120-000E656011D3401E, 00008110-000C341826B9401E, 00008110-001155D23E38401E, 00008030-001C38593420402E [debug] [XCUITest] Creating iDevice object with udid '00008120-000E656011D3401E' [XCUITest] Determining device to run tests on: udid: '00008120-000E656011D3401E', real device: true [debug] [BaseDriver] Event 'xcodeDetailsRetrieved' logged at 1666063521611 (23:25:21 GMT-0400 (Eastern Daylight Time)) [debug] [BaseDriver] Event 'appConfigured' logged at 1666063521611 (23:25:21 GMT-0400 (Eastern Daylight Time)) [debug] [BaseDriver] Event 'resetStarted' logged at 1666063521612 (23:25:21 GMT-0400 (Eastern Daylight Time)) [debug] [XCUITest] Reset: running ios real device reset flow [debug] [BaseDriver] Event 'resetComplete' logged at 1666063521612 (23:25:21 GMT-0400 (Eastern Daylight Time)) [WebDriverAgent] Using WDA path: '/usr/local/lib/node_modules/appium/node_modules/appium-webdriveragent' [WebDriverAgent] Using WDA agent: '/usr/local/lib/node_modules/appium/node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj' [debug] [XCUITest] Crash reports root '/Users/krish/Library/Logs/CrashReporter/MobileDevice/iPhone 14 Pro' does not exist. Got nothing to gather. [debug] [BaseDriver] Event 'logCaptureStarted' logged at 1666063521804 (23:25:21 GMT-0400 (Eastern Daylight Time)) [XCUITest] Setting up real device [debug] [WebDriverAgent] No obsolete cached processes from previous WDA sessions listening on port 8388 have been found [DevCon Factory] Requesting connection for device 00008120-000E656011D3401E on local port 8388, device port 8388 [debug] [DevCon Factory] Cached connections count: 0 [DevCon Factory] Successfully requested the connection for 00008120-000E656011D3401E:8388 [debug] [XCUITest] Starting WebDriverAgent initialization with the synchronization key 'XCUITestDriver' [debug] [WD Proxy] Matched '/status' to command name 'getStatus' [debug] [WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8388/status] with no body [debug] [WD Proxy] Got response with status 200: {"value":{"message":"WebDriverAgent is ready to accept commands","state":"success","os":{"testmanagerdVersion":28,"name":"iOS","sdkVersion":"16.0","version":"16.0.3"},"ios":{"ip":"169.254.236.138"},"ready":true,"build":{"upgradedAt":"1665468539000","time":"Oct 11 2022 14:32:48","productBundleIdentifier":"com.facebook.WebDriverAgentRunner"}},"sessionId":null} [debug] [WebDriverAgent] Upgrade timestamp of the currently bundled WDA: 1665468539000 [debug] [WebDriverAgent] Upgrade timestamp of the WDA on the device: 1665468539000 [WebDriverAgent] Will reuse previously cached WDA instance at 'http://127.0.0.1:8388/' with 'com.facebook.WebDriverAgentRunner'. Set the wdaLocalPort capability to a value different from 8388 if this is an undesired behavior. [debug] [XCUITest] Trying to start WebDriverAgent 2 times with 2000ms interval [debug] [BaseDriver] Event 'wdaStartAttempted' logged at 1666063522074 (23:25:22 GMT-0400 (Eastern Daylight Time)) [WebDriverAgent] Using provided WebdriverAgent at 'http://127.0.0.1:8388/' [debug] [WD Proxy] Matched '/status' to command name 'getStatus' [debug] [WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8388/status] with no body [debug] [WD Proxy] Got response with status 200: {"value":{"message":"WebDriverAgent is ready to accept commands","state":"success","os":{"testmanagerdVersion":28,"name":"iOS","sdkVersion":"16.0","version":"16.0.3"},"ios":{"ip":"169.254.236.138"},"ready":true,"build":{"upgradedAt":"1665468539000","time":"Oct 11 2022 14:32:48","productBundleIdentifier":"com.facebook.WebDriverAgentRunner"}},"sessionId":null} [debug] [BaseDriver] Event 'wdaSessionAttempted' logged at 1666063522082 (23:25:22 GMT-0400 (Eastern 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://127.0.0.1:8388/session] with body: {"capabilities":{"firstMatch":[{"bundleId":"com.apple.TestFlight","arguments":[],"environment":{},"eventloopIdleDelaySec":0,"shouldWaitForQuiescence":true,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true,"shouldTerminateApp":true,"forceAppLaunch":true,"useNativeCachingStrategy":true,"forceSimulatorSoftwareKeyboardPresence":true,"defaultAlertAction":"dismiss"}],"alwaysMatch":{}}} [HTTP] --> GET /wd/hub/status [HTTP] {} [debug] [GENERIC] Calling AppiumDriver.getStatus() with args: [] [debug] [GENERIC] Responding to client with driver.getStatus() result: {"build":{"version":"1.22.3"}} [HTTP] <-- GET /wd/hub/status 200 1 ms - 68 [HTTP] [debug] [WebDriverAgent] Parsed BUILD_DIR configuration value: '/Users/krish/Library/Developer/Xcode/DerivedData/WebDriverAgent-ciegwgvxzxdrqthilmrmczmqvrgu/Build/Products' [debug] [WebDriverAgent] Got derived data root: '/Users/krish/Library/Developer/Xcode/DerivedData/WebDriverAgent-ciegwgvxzxdrqthilmrmczmqvrgu' [debug] [WD Proxy] Got response with status 200: {"value":{"sessionId":"50146C2F-4481-40FC-A67C-D2E910F01F60","capabilities":{"device":"iphone","browserName":"TestFlight","sdkVersion":"16.0.3","CFBundleIdentifier":"com.apple.TestFlight"}},"sessionId":"50146C2F-4481-40FC-A67C-D2E910F01F60"} [WD Proxy] Determined the downstream protocol as 'W3C' [debug] [BaseDriver] Event 'wdaSessionStarted' logged at 1666063523326 (23:25:23 GMT-0400 (Eastern Daylight Time)) [debug] [BaseDriver] Event 'wdaStarted' logged at 1666063523326 (23:25:23 GMT-0400 (Eastern 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 1666063523327 (23:25:23 GMT-0400 (Eastern Daylight Time)) [debug] [BaseDriver] The value of 'elementResponseAttributes' setting did not change. Skipping the update for it [debug] [BaseDriver] The value of 'shouldUseCompactResponses' setting did not change. Skipping the update for it [debug] [W3C (5241fd69)] Responding to client with driver.reset() result: null [HTTP] <-- POST /wd/hub/session/5241fd69-7b72-4fec-80d3-d40b2a8b5cb2/appium/app/reset 200 2761 ms - 14 [HTTP] [HTTP] --> POST /wd/hub/session/5241fd69-7b72-4fec-80d3-d40b2a8b5cb2/execute/sync [HTTP] {"script":"mobile: alert","args":[{"action":"dismiss"}]} [debug] [W3C (5241fd69)] Calling AppiumDriver.execute() with args: ["mobile: alert",[{"action":"dismiss"}],"5241fd69-7b72-4fec-80d3-d40b2a8b5cb2"] [debug] [XCUITest] Executing command 'execute' [debug] [WD Proxy] Matched '/alert/dismiss' to command name 'postDismissAlert' [debug] [WD Proxy] Proxying [POST /alert/dismiss] to [POST http://127.0.0.1:8388/session/50146C2F-4481-40FC-A67C-D2E910F01F60/alert/dismiss] with body: {} [WD Proxy] Got response with status 404: {"value":{"error":"no such alert","message":"An attempt was made to operate on a modal dialog when one was not open","traceback":""},"sessionId":"50146C2F-4481-40FC-A67C-D2E910F01F60"}

KazuCocoa commented 2 years ago

{"desiredCapabilities":{"server:CONFIG_UUID":"34659b82-a16d-4e43-a1ca-0d67a5fdff6a","noReset":false,"bundleId":"com.apple.TestFlight","autoDismissAlerts":true,"deviceName":"iPhone 14 Pro","fullReset":false,"wdaLocalPort":8388,"wdaStartupRetryInterval":2000,"autoLaunch":true,"newCommandTimeout":120,"platformVersion":"12.2","automationName":"XCUITest","wdaStartupRetries":2,"platformName":"ios","udid":"00008120-000E656011D3401E"},"capabilities":{"firstMatch":[{"platformName":"ios","server:CONFIG_UUID":"34659b82-a16d-4e43-a1ca-0d67a5fdff6a"}]}}

The request only had old protocol, which was not W3C as full capabilities set. Then, appium 2 and appium-inspector do not work since they follow w3c webdriver protocol as the primary method. Java client v7 can work since it sends both protocol, but v8 won't work.

You can use https://github.com/appium/appium-desktop 's inspector part for your use case.

krishtoautomate commented 2 years ago

why apply w3c rules to appium inspector? isn't it used for debugging and people might use it for some new or custom capabilities and might face unrequired errors or completely blocked. Why not just add warnings?

KazuCocoa commented 2 years ago

Since Appium inspector is designed for appium 2 as its readme. The appium 2 expects w3c, so appium-inspector also follows it as primary client, webdriverio. Appium itself has been supported both protocol for long since maybe v1.10 or around, so this inspector change should not break them.

In this (i guess grid v3?) case, it seems like your grid config? partially converted requests as

"capabilities":{"firstMatch":[{"platformName":"ios","server:CONFIG_UUID":"34659b82-a16d-4e43-a1ca-0d67a5fdff6a"}]}}

(I'm not so familiar with the grid configuration though)

So, as the inspector, maybe it can leave a note to use the old appium-desktop for grid v3 as it may have an issue in the inspector.

krishtoautomate commented 2 years ago

Im using grid v3, with custom capability matcher udid.

Can anyone guide me to make it work with appium:udid

KazuCocoa commented 2 years ago

Perhaps it can by specifying grid config with appium: capabilities: https://discuss.appium.io/t/grid-appium-and-custom-capabilities/23800

I'm not sure how grid v3 is compatible w3c spec, so potentially it has difficulties in the grid itself.

https://discuss.appium.io/ may help to ask questions.

krishtoautomate commented 1 year ago

fixed. changed capabilityMatcher to match appium:$UDID with node capability $UDID in Grid2. thanks