0
私は、アクティビティをテストしているAndroidViewClientスクリプトを持っています。私のAndroidアプリケーションのボタンをクリックすると、新しいActivityインスタンスが作成されます。私のpythonスクリプトのViewClientインスタンスは、新しいアクティビティが開始された後に再作成する必要があるようです。そうですか?このようなもの:新しいアクティビティが開始されている場合、ViewClientは無効ですか?
# My main activity is started here.
vc = ViewClient(device, serialno)
myBtn = vc.findViewById("btnStartNewActivity")
myBtn.touch() # this starts a new activity.
time.sleep(5)
# It seems like ViewClient is still pointing at
# the previous activity.
vc.traverse()
# I can do this to get it to see the new Activity:
vc = ViewClient(device, serialno)
vc.traverse() # now it's ok.
これは正しい方法ですか?
おかげ