当前位置:首页 > robotium 中文API
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
waitForCondition(Condition condition, final int timeout) //等待条件是否满足
支持WebView操作
waitForWebElement(By by) //Example: waitForWebElement(By.id(―id‖)); waitForWebElement(By by, int timeout, boolean scroll)
waitForWebElement(By by, int match, int timeout, boolean scroll)
clickOnWebElement(WebElement webElement) //点击某个WebElement clickOnWebElement(By by)
clickOnWebElement(By by, int match)
clickOnWebElement(By by, int match, boolean scroll)
enterTextInWebElement(By by, String text) //某个WebElement中输入指定文本
typeTextInWebElement(By by, String text)
typeTextInWebElement(By by, String text, int match)
typeTextInWebElement(WebElement webElement, String text) clearTextInWebElement(By by) getWebElement(By by, int index) getCurrentViews(Class classToFilterBy)
getCurrentViews(Class classToFilterBy, View parent)
takeScreenshot(String name, int quality) //截取图片并且以一定比例压缩 removeInvisibleViews(Iterable viewList)
filterViews(Class classToFilterBy, Iterable> viewList) filterViewsToSet(Class classSet, Iterable viewList) sortViewsByLocationOnScreen(List views)
sortViewsByLocationOnScreen(List views, boolean yAxisFirst) getNumberOfMatches(String regex, View view, Set uniqueTextViews)
RobotiumUtils:
弃用的方法:
? ? ?
getAllOpenedActivities() finishInactiveActivities()
getCurrentXViews //replaced by getCurrentViews(Class classToFilterBy). Example: getCurrentViews(ListView.class)
?
Robotium中文API(05)-solo. clickLongInList
作者 HAO.SHEN
? ?
clickLongInList
?
public ArrayList
?
长按一个给定的列表行并返回此行显示的TextView集合,默认操作第一个找到的ListView。
?
参数:
?
line – 被点击的行
?
Returns:
?
返回此行一个包含TextView对象的数组
?
public ArrayList
?
int index)
?
长按一个指定的ListView中给定的列表行并返回此行显示的TextView集合。
?
参数:
?
line – 被点击的行
?
index – 列表索引. 1 表示当前有两个列表
?
Returns:
?
返回位于指定列表中指定行的TextView对象数组
?
public ArrayList
?
int index,
?
int time)
?
长按一个指定的ListView中给定的列表行并返回此行显示的TextView集合。
?
参数:
?
line – 被点击的行
?
index – 列表索引. 1 表示当前有两个列表
?
time – 长按的时间
?
Returns:
?
返回位于指定列表中指定行的TextView对象数组
Robotium中文
API(06)-solo.clickLongOnScreen
作者 HAO.SHEN
clickLongOnScreen
public void clickLongOnScreen(float x, float y) 长按屏幕上给定的坐标 参数: x – x的坐标 y – y的坐标
public void clickLongOnScreen(float x, float y, int time) 长按屏幕上给定的坐标一段时间 参数: x – x的坐标 y – y的坐标 time – 长按时间
共分享92篇相关文档