我们正在尝试使用AWS Device Farm提供的内置: Explorer和Fuzz测试在AWS Device Farm上测试我们的应用程序,但当应用程序启动时,它们无法单击权限对话框。该应用程序的测试适用于6.0以下的android版本,因为android在默认情况下会根据应用程序的请求提供权限。有没有解决这个问题的办法?
发布于 2019-08-17 06:42:01
尝试使用自定义环境运行您自己的adb猴子测试。只需上传一个应用程序和一个带有APPIUM_NODE测试类型的虚拟测试包即可。然后尝试我编写的这个yml,它将提取包的名称和权限,并尝试自动接受它们,然后运行adb monkey命令。
version: 0.1
phases:
install:
commands:
pre_test:
commands:
test:
commands:
- export PACKAGE_NAME=$(aapt list -a $DEVICEFARM_APP_PATH | sed -n "/^Package Group[^s]/s/.*name=//p")
# sanity check to make sure the package name exists
- echo "Package name:"
- echo "$PACKAGE_NAME"
- adb shell pm list packages -f | grep $PACKAGE_NAME
- aapt d permissions $DEVICEFARM_APP_PATH | cut -d "=" -f 2 | xargs -I {} adb shell pm grant $PACKAGE_NAME {}
# more info on this command can be found here https://developer.android.com/studio/test/monkey
- adb shell monkey -v -s 1534494405270 --throttle 500 --pct-touch 45 --pct-motion 45 --pct-trackball 0 --pct-nav 0 --pct-majornav 0 --pct-syskeys 0 --pct-appswitch 10 --pct-anyevent 0 -p $PACKAGE_NAME 1000 > $DEVICEFARM_LOG_DIR/monkey.log
-
post_test:
commands:
artifacts:
# By default, Device Farm will collect your artifacts from following directories
- $DEVICEFARM_LOG_DIRhttps://stackoverflow.com/questions/56286114
复制相似问题