0

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?

Prophet
  • 32,350
  • 22
  • 54
  • 79

2 Answers2

1

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()
Diego Torres Milano
  • 65,697
  • 9
  • 111
  • 134
  • It worked but: I added try: sys.path.append(os.path.join(os.environ['ANDROID_VIEW_CLIENT_HOME'], 'src')) except: pass code to code generated by culebra. Without this it presented an exception: ImportError: No module named dtmilano I suppose you adding this for future culebra versions Thanks! – Prophet May 03 '14 at 19:49
0

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

Power
  • 41
  • 5