robotium 中获取相同类型的自控觉得获取方法(使用Android的ViewGroup控件的getChildAt(index)获取)

来源:互联网 发布:mac网络连接鉴定失败 编辑:程序博客网 时间:2024/04/27 06:56

获取元素控件,

首页 使用robotium 的solo 对象调用 robotium中的API方法如下是一小部分

getText(int index)

getText(String text)

getText(String text, boolean onlyVisible)

getTopParent(android.view.View view)

getViews()

getView(Class<T> viewClass, int index)

getView(String id, int index)

getView(String id)

getView(int id, int index)

getView(int id, int index)

getViews(android.view.View parent)

getWebElement(By by, int index)

获取当对应的View组件或者是ViewGroup组件的子类组件

然后可以直接使用ViewGroup组件中的getChildAt(index)  方法就可以获取其 子控件元素了

0 0