appium python中的android uiautomator定位,,text定位:dri
appium python中的android uiautomator定位,,text定位:dri
text定位:
driver.find_element_by_android_uiautomator(‘new UiSelector().text("请输入手机号")‘)
#模糊定位
driver.find_element_by_android_uiautomator(‘new UiSelector().textContains("请输入")‘)
resourceID定位:
driver.find_element_by_android_uiautomator(‘new UiSelector().resourceId("cn.com.open.mooc:id/et_phone_edit")‘)
className定位:
driver.find_element_by_android_uiautomator(‘new UiSelector().className("android.widget.EditText")‘)
index 定位:
driver.find_element_by_android_uiautomator(‘new UiSelector().index(1)‘)
className + index 方式:
driver.find_element_by_android_uiautomator(
‘new UiSelector().className("%s").childSelector(new UiSelector().index("%d"))‘)
伪xpath方法定位:
#通过同级元素定位同级元素
driver.find_element_by_android_uiautomator(‘new UiSelector().text("Custom View").fromParent(new UiSelector().text("Accessibility Service"))‘).click()
#通过父级元素定位子集元素
driver.find_element_by_android_uiautomator(‘new UiSelector().className("android.widget.ListView").childSelector(new UiSelector().text("Custom View"))‘).click()
appium python中的android uiautomator定位
相关内容
- Python练习题,,T1.编写程序,输入
- 如何使用python远程操作linux,,在云服务测试中,往往
- python接口自动化6-参数化关联,,前言接口中我们经常需
- Win10(PowerShell)下Python命令行tab自动补全,,用Python,直接
- python标准库:base64模块,,Base64是一种用
- python基础知识--标志位的设定,,在单层循环的退出中,
- python 接口类、抽象类、多态,,参考https://
- Linux 安装python3.7.0,,centos系统本身
- python中列表的常用方法,,列表中的方法# 列表
- python 可视化,python可视化窗口编程,基本画图操作:i
评论关闭