Android自动化工具Monkeyrunner使用(六) —— touch
2012-10-10 16:39
465 查看
本章主要介绍touch事件
void
touch ( integer x,
integer y, string type)
Sends a touch event specified by type to the screen location specified by x and y.Arguments
x | The horizontal position of the touch in actual device pixels, starting from the left of the screen in its current orientation. |
---|---|
y | The vertical position of the touch in actual device pixels, starting from the top of the screen in its current orientation. |
type | The type of key event to send. The allowed values are DOWN, UP, and DOWN_AND_UP. |
string
DOWN
press()or
touch()value. Specifies that a DOWN event type should be sent to the device, corresponding to pressing down on a key or touching the screen.
string
UP
press()or
touch()value. Specifies that an UP event type should be sent to the device, corresponding to releasing a key or lifting up from the screen.
string
DOWN_AND_UP
press(),
touch()or
type()value. Specifies that a DOWN event type followed by an UP event type should be sent to the device, corresponding to typing a key or clicking the screen.
例子:
for i in range(200):
device.touch(100,600,"DOWN_AND_UP")
MonkeyRunner.sleep(5)
device.touch(240,750,"DOWN")
MonkeyRunner.sleep(5)
device.touch(400,750,"UP")
MonkeyRunner.sleep(5)
相关文章推荐
- Android自动化工具Monkeyrunner使用(三)
- Android自动化工具Monkeyrunner使用(四)
- Android自动化工具Monkeyrunner使用(六) —— 根据ID查找对象
- Android自动化工具Monkeyrunner使用(六) —— python 里的import
- Android自动化工具Monkeyrunner使用(五)
- Android自动化工具Monkeyrunner使用(七) —— 录制、回放脚本
- Android自动化工具Monkeyrunner使用(二)
- Android自动化工具Monkeyrunner使用(七) ——在linux环境ubuntu平台上使用Eclipse运行monkeyrunne
- Android自动化工具Monkeyrunner使用(一)
- android自动化工具之--Monkeyrunner使用方法及实例
- Android自动化工具Monkeyrunner使用(六) —— 使用log日志功能
- Android自动化工具Monkeyrunner使用(六) —— Eclipse + Jython 环境配置
- Android自动化工具Monkeyrunner使用(六) —— Eclipse + Jython demo
- Android自动化工具Monkeyrunner使用之——ISMS(启动APK并截图查看)
- android自动化测试工具【UiAutomator】——使用Indec来定位控件
- 一步一步使用Monkeyrunner实现Android的自动化测试
- Android自动化测试工具 UiAutomator使用详解
- 有关自动化测试工具monkey&monkeyrunner的使用经验小结
- 在Macbook上配置使用Android自动化测试工具uiautomator