appium / appium-for-mac

[deprecated] Application for automating a mac app with JSON wire protocol
Apache License 2.0
194 stars 70 forks source link

AfM can only click on certain objects (AXButton, AXCheckbox, etc) #62

Open Jiurong-Yang opened 5 years ago

Jiurong-Yang commented 5 years ago

It seems that the PFAssistive framework only can perform the click action with AXButton elements. All other element types I've tried to click has failed with this message.

[W3C (83f3a75d)] Driver proxy active, passing request on via HTTP proxy [debug] [WD Proxy] Matched '/wd/hub/session/83f3a75d-5b40-4f23-97c8-58dabbad713d/element/29/click' to command name 'click' [debug] [WD Proxy] Proxying [POST /wd/hub/session/83f3a75d-5b40-4f23-97c8-58dabbad713d/element/29/click] to [POST http://127.0.0.1:4622/wd/hub/session/Y29so5HN/element/29/click] with body: {"sessionId":"83f3a75d-5b40-4f23-97c8-58dabbad713d","id":"29"} [debug] [WD Proxy] Got response with status 200: {"status":13,"sessionId":"Y29so5HN","value":{"message":"An unknown server-side error occurred while processing the command."}} [WD Proxy] Got an unexpected response: {"status":13,"sessionId":"Y29so5HN","value":{"message":"An unknown server-side error occurred while processing the command."}} [debug] [W3C (83f3a75d)] Encountered internal error running command: ProxyRequestError: Could not proxy command to remote server. Original error: The request to /wd/hub/session/83f3a75d-5b40-4f23-97c8-58dabbad713d/element/29/click has failed [debug] [W3C (83f3a75d)] at JWProxy.proxy (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/jsonwp-proxy/proxy.js:181:13) [debug] [W3C (83f3a75d)] at ProtocolConverter.convertAndProxy (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/jsonwp-proxy/protocol-converter.js:216:12) [debug] [W3C (83f3a75d)] at JWProxy.proxyCommand (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/jsonwp-proxy/proxy.js:225:12) [debug] [W3C (83f3a75d)] at JWProxy.proxyReqRes (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/jsonwp-proxy/proxy.js:276:28) [debug] [MJSONWP] Matched JSONWP error code 13 to UnknownError [HTTP] <-- POST /wd/hub/session/83f3a75d-5b40-4f23-97c8-58dabbad713d/element/29/click 500 892 ms - 810

Jiurong-Yang commented 5 years ago

The ones that I know the AfM driver cannot click are, AXStatictext, AXImage, AXGroup, etc. It seems like this is a fundimental within the PFAssist framework which AfM relies on. But a possible work around is to preform pointer moves/click actions using the target element's coordinate.