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.
這是正確的方法嗎?
感謝