'automationName' = 'UiAutomator2'java
appium跨平台,可是uiautomator只针对安卓android
1. 安卓要求4.3以上git
2. 测试框架:正则表达式
A. UIAutomatorViewer:检查布局层次结构的查看器的工具,以前介绍过。app
B. UIDevice类,能够访问设备属性,执行系统操做,用于检索状态信息并在目标设备上执行操做的API框架
C. UIAutomatorAPI,支持跨应用程序UI测试的API工具
code = 'new UiSelector().className("android.widget.TextView").text("口碑最佳")’布局
ele = driver.find_element_by_android_uiautomator(code)测试
code = 'new UiSelector().resourceId("com.ibox.calculators:id/digit3")'ui
ele = driver.find_element_by_android_uiautomator(code)
code = ‘new UiSelector().resourceId("io.manong.developerdaily:id/tab_bar").childSelector(new UiSelector().className("android.widget.TextView").instance(3))’
1. textContains:文本包含
2. textStartsWith:文本以什么开头
3. textMatches:文本匹配什么正则表达式