【uiautomator】UiScollable

UiScollable

描述:UiScrollable是一个UiCollection,支持在滚动时寻找items,此类可用于垂直或水平滚动

公共构造函数

UiScrollabel(UiSelector container)

UiScrollable是一个Collection,亦需要UiSelector去识别scrollable集合元素容器

公共方法

boolean

flingBackward()

以5步长快速向后滑动

boolean

flingForward()

以5步长快速向前滑动

boolean

flingToBeginning(int maxSwipes)

自定义步长快速滑动到开始

boolean

flingToEnd(int maxSwipes)

自定义步长快速滑动到结束

UiObject

getChildByDescription(UiSelector childPattern,String text,boolean allowScrollSearch)

见getChildByDescription(UiSelector, String);是否允许滚动查找具备UiSelector条件与文本描述条件的UiObject对象

UiObject

getChildByDescription(UiSelector childPattern,String text)

默认允许滚动查找具备UiSelector条件与文本描述条件的UiObject对象

UiObject

getChildByInstance(UiSelector childPattern,int instance)

获取具备UiSelector条件的子集,再从子集中按照实例筛选想要的元素;仅操作在可见并且不执行滚动items

UiObject

getChildByText(UiSelector childPattern,String text,boolean allowScrollSearch)

是否允许滚动获取具备UiSelector条件与文本的UiObject对象

UiObject

getChildByText(UiSelector childPattern,String text)

默认允许滚动获取具备UiSelector条件与文本的UiObject对象

int

getMaxSearchSwipes()

返回在滚动搜索时执行拖拽的最大数量,默认为30;见setMaxSearchSwipes(int)

double

getSwipeDeadZonePercentage()

返回无接触区域百分比。默认是10%

boolean

scrollBackward(int steps)

自定义步长执行向后滑动

boolean

scrollBackward()

默认步长55向后滑动

boolean

scrollDescriptionIntoView(String text)

滚动到描述所在位置,并让他尽量局域屏幕中央

boolean

scrollFoward()

见scrollFoward(int steps)默认步长55向前滑动

boolean

scrollFoward(int steps)

自定义步长执行向前滑动

boolean

scrollIntoView(UiSelector selector)

滚动到条件元素所在位置,并让他尽量局域屏幕中央

boolean

scrollTextIntoView(String text)

滚动到文本对象所在位置,并让他尽量局域屏幕中央

boolean

scrollToBeginning(int maxSwipes)

滚动到最开始位置

boolean

scrollToBeginning(int maxSwipes,int steps)

自定义步长滚动到最开始位置

boolean

scrollToEnd(int maxSwipes,int steps)

自定义步长滚动到结束位置

boolean

scrollToEnd(int maxSwipes)

滚动到结束位置

void

setAsHorizontalList()

设置水平方法滚动

void

setAsVerticalList(0

设置垂直方向滚动

void

setMaxSearchSwipes(int swipes)

设置拖拽移动最大次数

void

setSwipedeadZonePercentage(double swipeDeadZonePercentage)

设置widget大小,在滑动时,视为无接触区域百分比

 

继承方法

com.android.uiautomator.core.UiObject

com.android.uiautomator.core.UiCollection

java.lang.Object

posted on 2015-06-17 10:41  wonderful0714  阅读(547)  评论(0编辑  收藏  举报

导航