androidviewclient - Is ViewClient invalid if new Activity is started? -


i have androidviewclient script testing activity. clicking button in android app creates new activity instance. seems viewclient instance in python script needs recreated after new activity launched - right? this:

# main activity started here. vc = viewclient(device, serialno) mybtn = vc.findviewbyid("btnstartnewactivity") mybtn.touch() # starts new activity. time.sleep(5)  # seems viewclient still pointing @  # previous activity.  vc.traverse()  # can see new activity: vc = viewclient(device, serialno) vc.traverse() # it's ok. 

is correct way it?

thanks

no, there's no need create new instance, have every time screen changes (whether it's new activity or same one) call

vc.dump() 

and new view hierarchy read (see viewclient#dump()).

recreating instance, in case, not setting autodump parameter , default value true invokes dump() automatically, invoking dump() more efficient.


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -