0

Recently I updated my appium version to 1.11.1 and after I did a basic validation like checking clickable elements state in a new screen layout of my Android app (in which previously I reviewed all items were "clickable=false" through the UI Automator Viewer tool), so after the test executed, I saw in the responses that all items were returned with property "clickable=true" instead and the size() method returned 14 elements instead of expected value '0'.

Here the validation step sample performed:

"driver.findElementsByAndroidUIAutomator("new UiSelector().clickable(true)").size()"

And the log response from Appium server:

[debug] [W3C (ee1567a8)] Calling AppiumDriver.findElements() with args: ["-android uiautomator","new UiSelector().clickable(true)","ee1567a8-d179-433a-870b-61403e6ce2f8"]
[debug] [BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator
[debug] [BaseDriver] Waiting up to 10000 ms for condition
[debug] [AndroidBootstrap] Sending command to android: {"cmd":"action","action":"find","params":{"strategy":"-android uiautomator","selector":"new UiSelector().clickable(true)","context":"","multiple":true}}
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {"cmd":"action","action":"find","params":{"strategy":"-android uiautomator","selector":"new UiSelector().clickable(true)","context":"","multiple":true}}
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: find
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Finding 'new UiSelector().clickable(true)' using 'ANDROID_UIAUTOMATOR' with the contextId: '' multiple: true
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Parsing selector: new UiSelector().clickable(true)
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] UiSelector coerce type: boolean arg: true
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[CLICKABLE=true]
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements selector:UiSelector[CLICKABLE=true]
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Element[] is null: (0)
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements tmp selector:UiSelector[INSTANCE=0, CLICKABLE=true]
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Element[] is null: (1)
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements tmp selector:UiSelector[INSTANCE=1, CLICKABLE=true]
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Element[] is null: (2)
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements tmp selector:UiSelector[INSTANCE=2, CLICKABLE=true]
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Element[] is null: (3)
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements tmp selector:UiSelector[INSTANCE=3, CLICKABLE=true]
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Element[] is null: (4)
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements tmp selector:UiSelector[INSTANCE=4, CLICKABLE=true]
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Element[] is null: (5)
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements tmp selector:UiSelector[INSTANCE=5, CLICKABLE=true]
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Element[] is null: (6)
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements tmp selector:UiSelector[INSTANCE=6, CLICKABLE=true]
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Element[] is null: (7)
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements tmp selector:UiSelector[INSTANCE=7, CLICKABLE=true]
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Element[] is null: (8)
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements tmp selector:UiSelector[INSTANCE=8, CLICKABLE=true]
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Element[] is null: (9)
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements tmp selector:UiSelector[INSTANCE=9, CLICKABLE=true]
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Element[] is null: (10)
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements tmp selector:UiSelector[INSTANCE=10, CLICKABLE=true]
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Element[] is null: (11)
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements tmp selector:UiSelector[INSTANCE=11, CLICKABLE=true]
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Element[] is null: (12)
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements tmp selector:UiSelector[INSTANCE=12, CLICKABLE=true]
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Element[] is null: (13)
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements tmp selector:UiSelector[INSTANCE=13, CLICKABLE=true]
[debug] [AndroidBootstrap] Received command result from bootstrap
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {"status":0,"value":[{"ELEMENT":"2"},{"ELEMENT":"3"},{"ELEMENT":"4"},{"ELEMENT":"5"},{"ELEMENT":"6"},{"ELEMENT":"7"},{"ELEMENT":"8"},{"ELEMENT":"9"},{"ELEMENT":"10"},{"ELEMENT":"11"},{"ELEMENT":"12"},{"ELEMENT":"13"},{"ELEMENT":"14"}]}
[debug] [W3C (ee1567a8)] Responding to client with driver.findElements() result: [{"element-6066-11e4-a52e-4f735466cecf":"2","ELEMENT":"2"},{"element-6066-11e4-a52e-4f735466cecf":"3","ELEMENT":"3"},{"element-6066-11e4-a52e-4f735466cecf":"4","ELEMENT":"4"},{"element-6066-11e4-a52e-4f735466cecf":"5","ELEMENT":"5"},{"element-6066-11e4-a52e-4f735466cecf":"6","ELEMENT":"6"},{"element-6066-11e4-a52e-4f735466cecf":"7","ELEMENT":"7"},{"element-6066-11e4-a52e-4f735466cecf":"8","ELEMENT":"8"},{"element-6066-11e4-a52e-4f735466cecf":"9","ELEMENT":"9"},{"element-6066-11e4-a52e-4f735466cecf":"10","ELEMENT":"10"},{"element-6066-11e4-a52e-4f735466cecf":"11","ELEMENT":"11"},{"element-6066-11e4-a52e-4f735466cecf":"12","ELEMENT":"12"},{"element-6066-11e4-a52e-4f735466cecf":"13","ELEMENT":"13"},{"element-6066-11e4-a52e-4f735466cecf":"14","ELEMENT":"14"}]
[HTTP] <-- POST /wd/hub/session/ee1567a8-d179-433a-870b-61403e6ce2f8/elements 200 5188 ms - 775

So anyone that can help if this could be related to an issue with Appium latest version itself or if I'm missing anything else on my validation step?

I did not find any issues reported though for latest Appium version HERE

Notes: Below the different libraries used and its versions.

  • Java client version: 7.0.0
  • Selenium Java client: 3.141.59
  • Appium version: 1.11.1

1 Answers1

0

Since Appium is using UIAutomator2 with its own client-server implementation, it's not relevant to use pretty old UI Automator Viewer tool that uses native UIAutomator from Android SDK.

The proper inspector is Appium Desktop, the new version of it is usually shipped as soon as new Appium server been released. It is not only UX friendly but uses Appium underneath and guarantees what you find with it will work in tests.

dmle
  • 3,498
  • 1
  • 14
  • 22