自動化用例編寫
2 導(dǎo)入依賴
l Python from import
l Java import
2 capabilities 設(shè)置
l Python dict
l Java Class
2 初始化driver
l Python webdriver.remote
l Java new AppiumDriver
2 元素定位與操作 find+action
2 斷言 assert
2 app apk地址
2 appPackage 包名
2 appActivity Activity名字
2 automationName 默認(rèn)使用
2 uiautomator noReset fullReset 是否在測試前后重置相關(guān)環(huán)境
2 unicodeKeyBoard resetKeyBoard 是否需要輸入非英文 之外的語言并在測試完成后重置輸入法
2 測試步驟三要素:
l 定位、交互、斷言
2 定位
l Id (重要)
l xpath(重要)
l accessibityId: content-desc
l 不推薦:class -ios -android
2 精確等待:Sleep 不推薦
2 全局隱式等待
l driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
l 默認(rèn)值是0,也就是不等待
2 顯式等待
l WebDriverWait wait = new WebDriverWait(driver, 10);
l WebElementelement=wait.until(ExpectedConditions.elementToBeClickable(By.id("someid")));