Question

While using latest 5.4.4 AndroidViewClient and 4.4.2 KitKat Android device I see desirable view ids with dump-simple.py provided file but when I try to use these ids with findViewByIdOrRaise method I receive an exception:

com.dtmilano.android.viewclient.ViewNotFoundException: Couldn't find View with ID='android.widget.ImageView fourier.milab:id/infoIcon' in tree with root=ROOT

I tried several times, no typos etc. So how can I use (touch etc.) these views?

Was it helpful?

Solution

Let culebra generate the script template for you

$ culebra -VC -d on -o /tmp/kitkat.py

the edit generated /tmp/kitkat.py script to suit your needs, for example if you want to touch the QSB bar, after the line with the findViewByIdOrRaise() add the touch()

# class=android.widget.RelativeLayout
com_android_launcher___id_qsb_search_bar = vc.findViewByIdOrRaise("com.android.launcher:id/qsb_search_bar")
com_android_launcher___id_qsb_search_bar.touch()

OTHER TIPS

I had the same issue and it was because of the app package I has set in my config file. if you have two build variants, make sure the app running has the correct package name stated in the config file

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top