问题来源:Appium 中的 UiAutomator1 对 Android 7.0 及以上不兼容,再做自动化测试时会出现元素定位不到的错误;UiAutomator2 或许能解决这个问题
问题说明:首先,capabilities 有这些:
{
"platformName": "Android",
"deviceName": "tiantian",
"automationName": "UiAutomator2",
"appPackage": "packagename",
"appActivity": "activity",
"autoGrantPermissions": true,
"udid": "127.0.0.1:6555",
"autoLaunch": false
}
在 start session 的时候,会出现下面这个错误
看日志内容,主要错误是:appium-uiautomator2-server-debug-androidTest.apk: Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES
(后面还有一些信息)
Failed to collect certificates from /data/app/vmdl691848278.tmp/base.apk: META-INF/CERT.SF has invalid digest for android/support/test/espresso/base/IdlingResourceRegistry_Factory.java in /data/app/vmdl691848278.tmp/base.apk
请教:这个问题可以怎么解决?
appium-desktop 版本:1.17.1