Android平台自动测试之Monkey测试工具(12)
发表于:2016-09-12来源:cnblogs作者:cnb_yangwei点击数:
标签:
23 device.press(KEYCODE_DPAD_DOWN,DOWN_AND_UP) 24 25 device.press(KEYCODE_DPAD_DOWN,DOWN_AND_UP) 26 27 device.press(KEYCODE_DPAD_DOWN,DOWN_AND_UP) 28 29 # Takes a screenshot 30 31 result = device.take
23 device.press('KEYCODE_DPAD_DOWN','DOWN_AND_UP')
24
25 device.press('KEYCODE_DPAD_DOWN','DOWN_AND_UP')
26
27 device.press('KEYCODE_DPAD_DOWN','DOWN_AND_UP')
28
29 # Takes a screenshot
30
31 result = device.takeSnapshot()
32
33 # Writes the screenshot to a file
34
35 result.writeToFile('./shotend.png','png')