Appium for iOS cannot assert an UIImageView (png file) as ‘enabled’ for me. During the find element it retries many times on 2 things, isDisplayed and isEnabled and ultimately fails. The return value of is Displayed is false and the return value for isEnabled is true. Now there is no attribute isVisible nor isDisplayed for the image although I’m not assertting anything about isDisplayed and isEnabled !!! It seems to me that because isDisplayed if false the whole call to assert isEnabled = true fails.
Bottom Line:
For an element to be found does it have isDisplayed = true?
OS = macOS High Sierra 10.13.6
XCode = 10.1 (10B61)
This repeats many times and my call to assert attribute ‘enabled’ = true fails, but seemingly fails because isDisplayed fails.
[2019-02-13 08:12:21][W3C (90f3f87f)] Responding to client with driver.findElement() result: {“element-6066-11e4-a52e-4f735466cecf”:“1D010000-0000-0000-4B44-000000000000”,“ELEMENT”:“1D010000-0000-0000-4B44-000000000000”}
[2019-02-13 08:12:21][HTTP] <-- POST /wd/hub/session/90f3f87f-13e4-4354-8752-c9ba792f7557/element 200 1327 ms - 137
[2019-02-13 08:12:21][HTTP]
[2019-02-13 08:12:21][HTTP] --> GET /wd/hub/session/90f3f87f-13e4-4354-8752-c9ba792f7557/element/1D010000-0000-0000-4B44-000000000000/displayed
[2019-02-13 08:12:21][HTTP] {}
[2019-02-13 08:12:21][W3C (90f3f87f)] Driver proxy active, passing request on via HTTP proxy
[2019-02-13 08:12:21][XCUITest] Executing command ‘proxyReqRes’
[2019-02-13 08:12:21][JSONWP Proxy] Matched ‘/wd/hub/session/90f3f87f-13e4-4354-8752-c9ba792f7557/element/1D010000-0000-0000-4B44-000000000000/displayed’ to command name ‘elementDisplayed’
[2019-02-13 08:12:21][JSONWP Proxy] Proxying [GET /wd/hub/session/90f3f87f-13e4-4354-8752-c9ba792f7557/element/1D010000-0000-0000-4B44-000000000000/displayed] to [GET http://localhost:8100/session/2F40F475-4ADB-42A7-8969-D7F682883297/element/1D010000-0000-0000-4B44-000000000000/displayed] with body: {}
[2019-02-13 08:12:22][JSONWP Proxy] Got response with status 200: “{\n “value” : false,\n “sessionId” : “2F40F475-4ADB-42A7-8969-D7F682883297”,\n “status” : 0\n}”
[2019-02-13 08:12:22][JSONWP Proxy] Replacing sessionId 2F40F475-4ADB-42A7-8969-D7F682883297 with 90f3f87f-13e4-4354-8752-c9ba792f7557
[2019-02-13 08:12:22][HTTP] <-- GET /wd/hub/session/90f3f87f-13e4-4354-8752-c9ba792f7557/element/1D010000-0000-0000-4B44-000000000000/displayed 200 197 ms - 77
[2019-02-13 08:12:22][HTTP]
[2019-02-13 08:12:23][HTTP] --> POST /wd/hub/session/90f3f87f-13e4-4354-8752-c9ba792f7557/element
[2019-02-13 08:12:23][HTTP] {“using”:“xpath”,“value”:"//XCUIElementTypeImage[@name=“panic_tutorial-01-ios.png”]",“sessionId”:“90f3f87f-13e4-4354-8752-c9ba792f7557”}
[2019-02-13 08:12:23][W3C (90f3f87f)] Calling AppiumDriver.findElement() with args: [“xpath”,"//XCUIElementTypeImage[@name=“panic_tutorial-01-ios.png”]",“90f3f87f-13e4-4354-8752-c9ba792f7557”]
[2019-02-13 08:12:23][XCUITest] Executing command ‘findElement’
[2019-02-13 08:12:23][BaseDriver] Valid locator strategies for this request: xpath, id, name, class name, -ios predicate string, -ios class chain, accessibility id
[2019-02-13 08:12:23][BaseDriver] Waiting up to 0 ms for condition
[2019-02-13 08:12:23][JSONWP Proxy] Matched ‘/element’ to command name ‘findElement’
[2019-02-13 08:12:23][JSONWP Proxy] Proxying [POST /element] to [POST http://localhost:8100/session/2F40F475-4ADB-42A7-8969-D7F682883297/element] with body: {“using”:“xpath”,“value”:"//XCUIElementTypeImage[@name=“panic_tutorial-01-ios.png”]"}
[2019-02-13 08:12:24][JSONWP Proxy] Got response with status 200: {“value”:{“ELEMENT”:“1D010000-0000-0000-4B44-000000000000”},“sessionId”:“2F40F475-4ADB-42A7-8969-D7F682883297”,“status”:0}
[2019-02-13 08:12:24][W3C (90f3f87f)] Responding to client with driver.findElement() result: {“element-6066-11e4-a52e-4f735466cecf”:“1D010000-0000-0000-4B44-000000000000”,“ELEMENT”:“1D010000-0000-0000-4B44-000000000000”}
[2019-02-13 08:12:24][HTTP] <-- POST /wd/hub/session/90f3f87f-13e4-4354-8752-c9ba792f7557/element 200 1313 ms - 137
[2019-02-13 08:12:24][HTTP]
[2019-02-13 08:12:24][HTTP] --> GET /wd/hub/session/90f3f87f-13e4-4354-8752-c9ba792f7557/element/1D010000-0000-0000-4B44-000000000000/displayed