'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:文本匹配什麼正則表達式