Appium scroll 滑动查找
2016-03-18 09:20
337 查看
首先看uiautomator如何实现滑动查找
UiScrollable scrollView = new UiScrollable(new UiSelector().className("android.widget" + ".ScrollView")); UiObject itemApps = scrollView.getChildByText(new UiSelector().className("android.widget" + ".TextView"),"Apps"); itemApps.click();
new一个 Uiscrollable 的对象,然后用getChild 的方法找到子元素。
Appium (Python-client)
def _find_by_scroll(self, item_name): item = self.driver.find_element_by_android_uiautomator( 'new UiScrollable(new UiSelector().scrollable(true).instance(0)).getChildByText(new UiSelector().className("android.widget.TextView"), "' + item_name + '")') item.click()
区别还是有的,用
scrollable(true)找到对象,
.instance(0)再获取子元素
相关文章推荐
- android开发 数组
- 对于ble ios作为中心设备收不到蓝牙外设广播信息的解决办法
- Swift学习总结(个人总结,以方便理解为主)
- android程序更换图标安装后不变解决办法
- Android二级分类列表GirdView
- android Unable to execute dex: Multiple dex files define Landroid/support/v4/accessibilityservice/A
- android图像变换之Matrix
- app-framework学习--动态管理panel
- android intent-filter
- Object 转 json 工具类
- iOS-初解绘画
- webView的缩放效果配置
- ios button 图标和文字位置设置
- appframework基础 : a标签的使用
- 微信智能客服管理 集成微信接口、聊天机器人于一体
- Langpack Yum Application yum install yum-langpacks
- Android 学习笔记(一)
- iOS中点击背景收键盘
- ios AutoLayout基础知识 汇总
- ios基本图形绘制