自动化用例编写
² 导入依赖
l Python from import
l Java import
² capabilities 设置
l Python dict
l Java Class
² 初始化driver
l Python webdriver.remote
l Java new AppiumDriver
² 元素定位与操作 find+action
² 断言 assert
² app apk地址
² appPackage 包名
² appActivity Activity名字
² automationName 默认使用
² uiautomator noReset fullReset 是否在测试前后重置相关环境
² unicodeKeyBoard resetKeyBoard 是否需要输入非英文 之外的语言并在测试完成后重置输入法
² 测试步骤三要素:
l 定位、交互、断言
² 定位
l Id (重要)
l xpath(重要)
l accessibityId: content-desc
l 不推荐:class -ios -android
² 精确等待:Sleep 不推荐
² 全局隐式等待
l driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
l 默认值是0,也就是不等待
² 显式等待
l WebDriverWait wait = new WebDriverWait(driver, 10);
l WebElementelement=wait.until(ExpectedConditions.elementToBeClickable(By.id("someid")));