android - Run AndroidViewClient from Java -
i want create testing environment android apps / uis based on monkeyrunner. goal provide environment automatically tests activities , ui elements edittext or button, not randomly creating touch/ gesture events doing 'meaningful' stuff finding edittext that's labeled 'email' , enter email adress it. did research on tools readily available , found chimpchat, androidviewclient , of course dtmilano.blogspot.de.
i'm not familiar python development, question if makes sense (and possible) try use avc java jython (i know still have learn python) or if unnecessary complication of things , should try develop such thing in plain python.
any input highly appreciated :)
androidviewclient tries keep same api style accustom use java, won't difficult learn it.
for example, instead of different approaches taken other tools, androidviewclient uses more familiar
vc.findviewbyid('id/some_id') to find views. introduces natural extensions api like
vc.findviewwithtext('sometext') and
vc.findviewwithtext(re.compile('[a-z]*')) to simplify things more, culebra introduced time ago. tool generate scripts can adapt needs few changes.
let's start contacts application in emulator or device, , press add, presented new contact entry form, , according example mentioned enter email address. once new contact form displayed, run:
$ culebra --verbose-comments --output=contacts.py and edit generated script contacts.py. locate line email field obtained, should like:
... # class=android.widget.edittext text="email" no_id57 = vc.findviewbyidorraise("id/no_id/57") ... and add
no_id57.type('donald@example.com') save script. run it. , you'll see how, if goes well, email address entered.
i'll creating more detailed example in separate post @ dtmilano.blogspot.com.
if still want use java, strictly speaking androidviewclient ported java (patches , sponsorships welcome) or can use uiautomator create similar tests.
Comments
Post a Comment