appium-for-mac icon indicating copy to clipboard operation
appium-for-mac copied to clipboard

elements not findable

Open jlipps opened this issue 7 years ago • 5 comments

I tried to find the "main display" element in the calculator app, to no avail. I tried many different ways, including the auto-generated AXPath from appium for mac (holding down the function key). I also manually constructed various AXPaths after looking at the source. am I missing something?

jlipps avatar Apr 28 '17 01:04 jlipps

@jlipps I'm not sure what "main display" is supposed to be. Are you referring to one of the screens in a multi-screen configuration?

stuartbrussell-intuit avatar Apr 28 '17 21:04 stuartbrussell-intuit

Maybe main window?

screen shot 2017-04-28 at 2 35 23 pm

stuartbrussell-intuit avatar Apr 28 '17 21:04 stuartbrussell-intuit

There's an element with AXDescription of "main display" -- it's the part where the calc output is displayed.

jlipps avatar Apr 28 '17 23:04 jlipps

Found it. You have to be in Scientific or Programmer mode. Basic doesn't have it. In one of those modes, hover over the displayed value.

stuartbrussell-intuit avatar May 01 '17 05:05 stuartbrussell-intuit

The AXPath I get in scientific mode ("/AXApplication[@AXTitle='Calculator']/AXWindow[@AXIdentifier='_NS:477' and @AXSubrole='AXStandardWindow']/AXGroup[@AXIdentifier='_NS:9']") is also not findable from my test, either in scientific or regular mode.

[HTTP] --> POST /wd/hub/session/cd0128db-e2c2-44ce-8a2f-2dd17879066d/elements {"using":"xpath","value":"/AXApplication[@AXTitle='Calculator']/AXWindow[@AXIdentifier='_NS:477' and @AXSubrole='AXStandardWindow']/AXGroup[@AXIdentifier='_NS:9']"}
[MJSONWP] Driver proxy active, passing request on via HTTP proxy
[debug] [JSONWP Proxy] Proxying [POST /wd/hub/session/cd0128db-e2c2-44ce-8a2f-2dd17879066d/elements] to [POST http://127.0.0.1:4622/wd/hub/session/Ogcccxnb/elements] with body: {"using":"xpath","value":"/AXApplication[@AXTitle='Calculator']/AXWindow[@AXIdentifier='_NS:477' and @AXSubrole='AXStandardWindow']/AXGroup[@AXIdentifier='_NS:9']"}
[Appium4Mac] [STDERR] 2017-05-01 10:10:55.789 AppiumForMac[45674:742311]
[Appium4Mac] [STDERR]
[Appium4Mac] [STDERR]
[Appium4Mac] [STDERR] ************* findAllUsingAbsoluteAXPath: /AXApplication[@AXTitle='Calculator']/AXWindow[@AXIdentifier='_NS:477' and @AXSubrole='AXStandardWindow']/AXGroup[@AXIdentifier='_NS:9']
[Appium4Mac] [STDERR] 2017-05-01 10:10:55.789 AppiumForMac[45674:742311] axPathComponents:(
[Appium4Mac] [STDERR] "AXApplication[@AXTitle='Calculator']",
[Appium4Mac] [STDERR] "AXWindow[@AXIdentifier='_NS:477' and @AXSubrole='AXStandardWindow']",
[Appium4Mac] [STDERR] "AXGroup[@AXIdentifier='_NS:9']"
[Appium4Mac] [STDERR] )
[Appium4Mac] [STDERR] 2017-05-01 10:10:55.811 AppiumForMac[45674:742311]
[Appium4Mac] [STDERR] ************* findAllUsingAbsoluteAXPath matchedNodes:(
[Appium4Mac] [STDERR] "<PFUIElement: 0x7fec19fc2280> {\n    AXDescription = \"<null>\";\n    AXHelp = \"<null>\";\n    AXRole = AXGroup;\n    AXRoleDescription = group;\n    AXSubrole = \"<null>\";\n    AXTitle = \"<null>\";\n}"
[Appium4Mac] [STDERR] )
[Appium4Mac] [STDERR]
[Appium4Mac] [STDERR]
[debug] [JSONWP Proxy] Got response with status 200: {"status":7,"sessionId":"Ogcccxnb","value":{"message":"An element could not be located on the page using the given search parameters."}}
[JSONWP Proxy] Replacing sessionId Ogcccxnb with cd0128db-e2c2-44ce-8a2f-2dd17879066d
[HTTP] <-- POST /wd/hub/session/cd0128db-e2c2-44ce-8a2f-2dd17879066d/elements 200 1014 ms - 164

(on an unrelated note, errors like these should be returned with http status 500, not http status 200)

jlipps avatar May 01 '17 17:05 jlipps