Hi,
I'm running into an issue when running my test on real device iOs (8.1.1) against appium server 1.3.1/1.3.3, certain elements that are present on a screen (being in focus) are not seen by isDisplayed().
Details:
- All elements under test have accessibility labels and the following attributes:
enabled: true
visible: false
valid: true
- Elements that are not visible to isDisplayed() during test run-time, are visible in Appium Inspector but not visible when switching Show Invisible OFF) and are found by appium server during runtime (see log below).
Questions:
- How exactly does isDisplayed() work in such situation?
- What differentiates visibility of elements to isDisplayed() when both: visible and not visible have similar element attributes values? For ex., elements that are visible to isDisplayed() during test runtime have the following attributes:
enabled: true
visible: false
valid: true
Elements that are not visible to isDisplayed() during runtime have the following attributes:
enabled: true
visible: false
valid: true
Appium server log:
//I'm looking for presence of a button called "Choose"
info: [debug] Pushing command to appium work queue: "au.getElementByName('Choose')"
info: [debug] Sending command to instruments: au.getElementByName('Choose')
info: [debug] [INST] 2014-11-20 22:25:38 +0000 Debug: evaluation finished
info: [debug] [INST] 2014-11-20 22:25:38 +0000 Debug: responding with:
info: [debug] [INST] 2014-11-20 22:25:38 +0000 Debug: Running system command #144: /Users/bzayats/local/bin/node /Users/Bzayats/local/lib/node_modules/appium/node_modules/appium-uiauto/bin/command-proxy-client.js /tmp/instruments_sock 2,{"status":0,"value":""}...
info: [debug] [INST] 2014-11-20 22:25:39 +0000 Debug: Got new command 144 from instruments: au.getElementByName('Choose')
info: [debug] [INST] 2014-11-20 22:25:39 +0000 Debug: evaluating au.getElementByName('Choose')
info: [debug] [INST] 2014-11-20 22:25:39 +0000 Debug: evaluation finished
info: [debug] [INST] 2014-11-20 22:25:39 +0000 Debug: Lookup returned [object UIAButton] with the name "Choose" (id: 421).
info: [debug] Socket data received (40 bytes)
info: [debug] Socket data being routed.
info: [debug] Got result from instruments: {"status":0,"value":{"ELEMENT":"421"}}
info: [debug] Responding to client with success: {"status":0,"value":{"ELEMENT":"421"},"sessionId":"e26cbb9a-e1e2-4c9f-9741-3e04a5f8c88a"}
info: <-- POST /wd/hub/session/e26cbb9a-e1e2-4c9f-9741-3e04a5f8c88a/element 200 1252.859 ms - 89 {"status":0,"value":{"ELEMENT":"421"},"sessionId":"e26cbb9a-e1e2-4c9f-9741-3e04a5f8c88a"}
info: --> GET /wd/hub/session/e26cbb9a-e1e2-4c9f-9741-3e04a5f8c88a/element/421/displayed {}
info: [debug] Pushing command to appium work queue: "au.getElement('421').isDisplayed()"
info: [debug] Sending command to instruments: au.getElement('421').isDisplayed()
info: [debug] [INST] 2014-11-20 22:25:39 +0000 Debug: responding with:
info: [debug] [INST] 2014-11-20 22:25:39 +0000 Debug: Running system command #145: /Users/bzayats/local/bin/node /Users/Bzayats/local/lib/node_modules/appium/node_modules/appium-uiauto/bin/command-proxy-client.js /tmp/instruments_sock 2,{"status":0,"value":{"ELEMENT":"421"}}...
info: [debug] [INST] 2014-11-20 22:25:40 +0000 Debug: Got new command 145 from instruments: au.getElement('421').isDisplayed()
info: [debug] [INST] 2014-11-20 22:25:40 +0000 Debug: evaluating au.getElement('421').isDisplayed()
info: [debug] Socket data received (28 bytes)
info: [debug] Socket data being routed.
info: [debug] Got result from instruments: {"status":0,"value":false}
info: [debug] Responding to client with success: {"status":0,"value":false,"sessionId":"e26cbb9a-e1e2-4c9f-9741-3e04a5f8c88a"}
info: <-- GET /wd/hub/session/e26cbb9a-e1e2-4c9f-9741-3e04a5f8c88a/element/421/displayed 200 1089.151 ms - 77 {"status":0,"value":false,"sessionId":"e26cbb9a-e1e2-4c9f-9741-3e04a5f8c88a"}