Taking a bunch of photos with androidviewclient trouble

107 views Asked by At

There is an issue, i need to automate making a photo to my android app, but there is no id for the button "take a snaphsot"

dump.py on a screen of taking a photo only shows:

C:\Users\Dmitry.Markovnikov>dump.py
android.widget.FrameLayout id/no_id/1
   android.widget.LinearLayout id/no_id/2
      android.widget.FrameLayout id/no_id/3
         android.widget.RelativeLayout id/no_id/4
            android.widget.LinearLayout id/no_id/5
               android.view.View id/no_id/6
            android.widget.LinearLayout id/no_id/7
               android.view.View id/no_id/8
            android.widget.RelativeLayout id/no_id/9

So how i should take a bunch of photos? Thank you!

update

i used dump.py -d and what i recieved on galaxy s 2 (android ver, 4.1.2):

C:\Users\Dmitry.Markovnikov>dump.py -d
android.widget.FrameLayout id/no_id/1  NAF
   android.widget.LinearLayout id/no_id/2  NAF
      android.widget.FrameLayout id/no_id/3  NAF
         android.widget.RelativeLayout id/no_id/4  NAF
            android.widget.LinearLayout id/no_id/5  NAF
               android.view.View id/no_id/6  NAF
            android.widget.LinearLayout id/no_id/7  NAF
               android.view.View id/no_id/8  NAF
            android.widget.RelativeLayout id/no_id/9  NAF

=(

1

There are 1 answers

0
Diego Torres Milano On

If you use

$ dump -d

the content descriptions will also be dumped and you'll obtain something like this

android.widget.FrameLayout id/no_id/1  NAF
   android.view.View id/no_id/2  NAF
      android.widget.FrameLayout id/no_id/3  NAF
         android.widget.FrameLayout id/no_id/4  NAF
            android.widget.FrameLayout id/no_id/5  NAF
               android.widget.RelativeLayout id/no_id/6  NAF
            android.view.View id/no_id/7  NAF
               android.widget.FrameLayout id/no_id/8  NAF
                  android.widget.FrameLayout id/no_id/9  NAF
                     android.view.View id/no_id/10  NAF
                  android.view.View id/no_id/11  NAF
                  android.widget.FrameLayout id/no_id/12  NAF
                     android.view.View id/no_id/13  NAF
                  android.widget.FrameLayout id/no_id/14  NAF
                     android.view.View id/no_id/15  NAF
                     android.widget.ImageView id/no_id/16  Camera, video, or panorama selector
                     android.widget.ImageView id/no_id/17  Shutter
        ...

then, in your script you can do something like

shutter = vc.findViewWithContentDescriptionOrRaise('''Shutter''')
shutter.touch()