uiautomator中InteractionController学习笔记(8)

来源:互联网 发布:数据分析excel面试题目 编辑:程序博客网 时间:2024/05/21 05:18

4.1版本


InteractionController将用户的键盘事件注入到android系统中,与系统进行交互(电视为什么不能设计成可组装,屏幕多大自己决定,想 多大就多大)


click(int,int)


在某点点击。


clickAndWaitForNewWindow(int,int,long)


点击某点,得带界面信息变化


freezeRotation()/unFreezeRotation()/isNaturalRotation()/setRotationLeft()/setRotationNatural()/setRotationRight()


这些方法在UiDevice里同样存在,名称也是一样的,不再解释,可以返回UiDevice参考。


getSystemLongPressTime()


通过ContentProvider从系统中获得长安时间


injectEventSync(InputEvent)


将用户的输入时间注入到系统中


isScreenOn()


判断屏幕是后点亮


longTap(int,int)


长按某一点


scrollSwipe(int,int,int,int,int)


sendKey(int,int)


发送键盘事件


sentText(String)


发送字符串


sleepDevice()/wakeDevice()


如果屏幕是亮的,则按power键让屏幕休眠/与sleep相反


swipe(Point[],int)


与UiDevice相同


swipe(int,int,int,int,int)


与UiDevice相同


touchDown(int,int)/touchMove(int,int)/touchUp(int,int)


按下/拖动/抬起。



0 0
原创粉丝点击