APP python simple automated test start time

Coding #:. 8 UTF- 
Import OS
Import Time
cmd = '-n com.android.browser the adb the shell -W / AM .BrowserActivity Start'
Content = os.popen, (cmd)
Print ( "successful start APP")
for Content in Line .readlines ():
Print (Line)
IF "thisTime" in Line:
StartTime = line.split ( ":") [. 1] # cutting time taken thistime: 300 to: a delimiter
BREAK
Print ( "you need StartTime It is equal to:% S "the StartTime%)
the time.sleep (. 3) # sleep 3S, closing the APP

cmd = 'Force the adb the shell AM-STOP com.android.browser'
Content = os.popen, (cmd) # Close the APP
Print (" Close successful APP ")

Guess you like

Origin www.cnblogs.com/l4130219/p/10973501.html