Android平臺自動測試之Monkey測試工具(11)

發表于:2016-09-12來源:cnblogs作者:cnb_yangwei點擊數: 標簽:
1 # Imports the monkeyrunner modules used by this program 2 3 from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice, MonkeyImage 4 5 # Connects to the current device, returning a MonkeyDevic
復制代碼
復制代碼
1 # Imports the monkeyrunner modules used by this program
2  
3  from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice, MonkeyImage

5 # Connects to the current device, returning a MonkeyDevice object

7 device = MonkeyRunner.waitForConnection()

9 # Takes a screenshot
10 
11 result = device.takeSnapshot()
12 
13 # Writes the screenshot to a file
14 
15 result.writeToFile('./shotbegin.png','png')
16 
17 # Presses the Down button
18 
19 device.press('KEYCODE_DPAD_DOWN','DOWN_AND_UP')
20 
21 device.press('KEYCODE_DPAD_DOWN','DOWN_AND_UP')
22 

原文轉自:http://www.cnblogs.com/iloverain/p/5604172.html

国产97人人超碰caoprom_尤物国产在线一区手机播放_精品国产一区二区三_色天使久久综合给合久久97