How to select the search items which have autocomplete view on android

can any one please help me how to select the items which have autocomplete selection on android.I am not able to see the elements through uiautomatorviewer.I can do the same thing by identifying the element coordinates but the element coordinates are varying from device to device.

Here I attached the sample screenshot which I am trying to solve the problem

Thanks in advance

Is it a native view or web view?

It is on android native app

Is this app is on Playstore…so that I can cross check from my side

It is there in australian playstore and the app name is ABCIview app.

It will be ease for me if you share APK to me(IF POSSIBLE) so that I can check from my side.

sorry…i cant share apk file.Can you please take it from app store

Not found in Playstore

its there in australian play store…

from my side, I can inspect the tab and list easily using uiautomatorviewer.
Look at the attached pic

It is not displaying on tablets…and it is able to show it on phones.Can you please try on android tablet

I dont have tab… why dont you try on phone and from there you can inspect and create your code completly.:slight_smile:

Possible from tablet also. :yum:
Check the attached screenshot

I tried that way but it is not selecting the correct element.Instead it is picking the episodes in the home page

Are you able to inspect the elements from dropdown list using uiautomtorviewer? From my side I can inspect them.

AutoComplete is handled by native android library, why are you validating android library. Do not consider such requirement in functional testing. If you are really interested to test such requirement then this needs to be covered at Android UI Unit/Integration test using espresso framework. It does not add any value if you cover this in Functional e2e tests.

How can i choose Abhijith or parth from the auto result? i am not able to get the ID or name in the UI automator? any one has a solution?

Directly use text property to locate the name //*[@text=‘Abhijith’]

I am getting “An element could not be located on the page using the given search parameters”

This is the code i used:
driver.find_element_by_xpath(“//*[@text=‘Autooo User1’]”).click()

Here is the Appium Node log:

info: ← POST /wd/hub/session/f5700f2f-5211-413e-af1b-3ac6b22f3478/element/5/value 200 6852.726 ms - 76 {“status”:0,“value”:true,“sessionId”:“f5700f2f-5211-413e-af1b-3ac6b22f3478”}
info: [debug] [BOOTSTRAP] [debug] Returning result: {“status”:0,“value”:true}
info: → POST /wd/hub/session/f5700f2f-5211-413e-af1b-3ac6b22f3478/element {“using”:“xpath”,“sessionId”:“f5700f2f-5211-413e-af1b-3ac6b22f3478”,“value”:“//[@text=‘Autooo User1’]“}
info: [debug] Waiting up to 0ms for condition
info: [debug] Pushing command to appium work queue: [“find”,{“strategy”:“xpath”,“selector”:”//
[@text=‘Autooo User1’]”,“context”:“”,“multiple”:false}]
info: [debug] [BOOTSTRAP] [debug] Got data from client: {“cmd”:“action”,“action”:“find”,“params”:{“strategy”:“xpath”,“selector”:"//[@text=‘Autooo User1’]“,“context”:”",“multiple”:false}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: find
info: [debug] [BOOTSTRAP] [debug] Finding //
[@text=‘Autooo User1’] using XPATH with the contextId: multiple: false
info: [debug] [BOOTSTRAP] [debug] Returning result: {“status”:7,“value”:"Could not find an element using supplied strategy. "}
info: [debug] Condition unmet after 179ms. Timing out.
info: [debug] Responding to client with error: {“status”:7,“value”:{“message”:“An element could not be located on the page using the given search parameters.”,“origValue”:"Could not find an element using supplied strategy. "},“sessionId”:“f5700f2f-5211-413e-af1b-3ac6b22f3478”}
info: ← POST /wd/hub/session/f5700f2f-5211-413e-af1b-3ac6b22f3478/element 500 182.361 ms - 230