openatx / uiautomator2

Android Uiautomator2 Python Wrapper
MIT License
6.38k stars 1.37k forks source link

BUG: container's Child element is taken from next container if child not exists #903

Open instasck opened 1 year ago

instasck commented 1 year ago

So I am having an Instagram tool. I am reading the all "containers" and getting full name using a child. image this is the way i do it: containers = self.device(resourceId='com.instagram.android:id/follow_list_container') Now when I reach the "sh__roseeeasd" container image

for i in range(1, 6):
    user_info_view = container.child(index=1)
    user_info_view.child(resourceId="com.instagram.android:id/follow_list_subtitle")

the fullname_view.get_text() is: image image

instead of return EMPTY / NOT FOUND.

Why is that ? the child should be only from parent !

SIMILAR: https://github.com/openatx/uiautomator2/issues/877 https://github.com/openatx/uiautomator2/issues/262

instasck commented 11 months ago

No response ? no one maintain this repo ?

instasck commented 4 months ago

THIS BUG HAPPEN 100% OF TIMES ! SUPER IMPOORANT TO FIX.

codeskyblue commented 4 months ago

Have you tried the latest version

instasck commented 4 months ago

I am using uiautomator2 2.16.26, did not see any update on change_log

codeskyblue commented 4 months ago

recommend using xpath instead of UiSelector