App自动化测试注意点

APP启动

  • 启动参数

caps = {}
caps["platformName"] = "Android"
caps["deviceName"] = "127.0.0.1:7555"
caps["appPackage"] = "com.tencent.wework"
caps["appActivity"] = ".launch.LaunchSplashActivity"
caps["automationName"] = "uiautomator2"
caps['noReset'] = "true"
# caps['skipServerInstallation'] = True
# caps['skipDeviceInitialization'] = True
self._driver = webdriver.Remote("http://localhost:4723/wd/hub", caps)
  • 关于获取toast

    • 一定要加上automationName参数,设置为uiautomator2 - uiautomator2必须都是小写

  • OPPO手机appium启动时报错:writing to settings requires:android.permission.WRITE_SECURE_SETTINGS,java.lang.SecurityException: Permission denial: writing to settings requires:android.permission.WRITE_SECURE_SETTINGS

    • 解决办法

      • 小米:在开发者选项里,把“USB调试(安全设置)"打开即可。 允许USB调试修改权限或模拟点击

      • oppo:在开发者选项里,把"禁止权限监控"打开即可。

posted @ 2021-05-20 18:33  王滚滚啊  阅读(122)  评论(0)    收藏  举报