霍格沃兹测试开发学社 ceshiren.com
总结:加班 + 背锅
Platform | Driver | Platform Versions | Appium Version | Driver Version |
---|---|---|---|---|
iOS | XCUITest | 9.3+ | 1.6.0+ | All |
UIAutomation | 8.0 to 9.3 | All | All | |
Android | Espresso | ?+ | 1.9.0+ | All |
UiAutomator2 | ?+ | 1.6.0+ | All | |
UiAutomator | 4.3+ | All | All | |
Mac | Mac | ?+ | 1.6.4+ | All |
Windows | Windows | 10+ | 1.6.0+ | All |
Android 环境配置:https://ceshiren.com/t/topic/2270
iOS 环境配置:https://ceshiren.com/t/topic/5530
几点建议:
app 入口,两种方式获取:
1、通过 logcat 日志获取
mac/Linux: adb logcat ActivityManager:I | grep "cmp"
windows: adb logcat ActivityManager:I | findstr "cmp" 后启动目标应用
2、通过 aapt 获取
mac/Linux: aapt dump badging wework.apk | grep launchable-activity
Windows: aapt dump badging wework.apk | findstr launchable-activity
启动应用命令
adb shell am start -W -n <package-name>/<activity-name> -S
Language/Framework | Github Repo and Installation Instructions |
---|---|
Ruby | https://github.com/appium/ruby_lib, https://github.com/appium/ruby_lib_core |
Python | https://github.com/appium/python-client |
Java | https://github.com/appium/java-client |
JavaScript (Node.js) | https://github.com/admc/wd |
JavaScript (Node.js) | https://github.com/webdriverio/webdriverio |
JavaScript (Browser) | https://github.com/projectxyzio/web2driver |
Objective C | https://github.com/appium/selenium-objective-c |
PHP | https://github.com/appium/php-client |
C# (.NET) | https://github.com/appium/appium-dotnet-driver |
RobotFramework | https://github.com/serhatbolsu/robotframework-appiumlibrary |
前提条件
已登录状态( noReset=True)
打卡用例:
1、打开【企业微信】应用
2、进入【工作台】
3、点击【打卡】
4、选择【外出打卡】tab
5、点击【第N次打卡】
6、验证【外出打卡成功】
7、退出【企业微信】应用
caps = {}
caps["platformName"] = "Android"
caps["deviceName"] = "wework"
caps["appPackage"] = "com.tencent.wework"
caps["appActivity"] = ".launch.LaunchSplashActivity"
caps["noReset"] = "true"
caps["ensureWebviewsHavePages"] = True
# 设置页面等待空闲状态的时间为0秒
caps['settings[waitForIdleTimeout]'] = 0
driver = webdriver.Remote("http://localhost:4723/wd/hub", caps)
driver.implicitly_wait(10)
driver.find_element(MobileBy.ANDROID_UIAUTOMATOR,
'new UiScrollable(new UiSelector().'
'scrollable(true).instance(0)).'
'scrollIntoView(new UiSelector().'
'text("打卡").instance(0));').click()
driver.find_element(MobileBy.XPATH, "//*[contains(@text,'次外出')]").click()
r = driver.find_element(MobileBy.ID, "com.tencent.wework:id/p3").text
assert r == "外出打卡成功"
使用 Appium 实现自动化添加联系人