再仔细看了下4.0中的方法:
java.util.ArrayList<android.view.View> |
getCurrentViews() Returns an ArrayList of the Views currently displayed in the focused Activity or Dialog. |
|
|
getCurrentViews(java.lang.Class<T> classToFilterBy) Returns an ArrayList of Views matching the specified class located in the focused Activity or Dialog. |
|
|
getCurrentViews(java.lang.Class<T> classToFilterBy, android.view.View parent) Returns an ArrayList of Views matching the specified class located under the specified parent. |
虽然只剩下了三个getCurrentViews()方法,但却可以替代3.6的众多方法
java.lang.Class<T> classToFilterBy参数传入相应的类即可
例如:ArrayList<ImageView> imageList=solo.getCurrentViews(ImageView.class);得到的即是ImageView
ArrayList<ImageView> imageList=solo.getCurrentViews(ImageView.class,parentView);
分类: 移动端测试
时间: 2024-10-28 10:58:06