【问题标题】:Android emulator tear down during tests runAndroid 模拟器在测试运行期间崩溃
【发布时间】:2020-06-05 16:02:03
【问题描述】:

伙计们! 我在 Android 模拟器上使用 Appium 运行我的 Android 测试。我在序列仿真器中运行测试的地方有时会拆除并忽略剩余的测试。

在 Appium 日志中我看到这个错误:

org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Error executing adbExec. Original error: 'Command 'C:\\Users\\Username\\AppData\\Local\\Android\\Sdk\\platform-tools\\adb.exe -P 5037 -s emulator-5554 shell settings delete global hidden_api_policy_pre_p_apps' exited with code 20'; Stderr: 'cmd: Can't find service: settings'; Code: '20'

有人遇到过这样的问题吗?

【问题讨论】:

  • 检查您的能力。也许,模拟器上没有安装应用程序。
  • 带大写一切正常。当我运行测试时,有时一切都很好,有时我会得到那个错误。

标签: selenium android-emulator appium appium-android selenide


【解决方案1】:

您正在尝试运行不允许的 adb-shell 命令。

Appium 有一些不安全的命令,通常不允许使用它们。

您可以在此处查看命令:Appium Insecure Features

adb-shell 命令(用于更改系统设置)就是其中之一。

点击链接了解如何防止 appium 对此进行检查。

如何解决:

在测试设置开始时,使用命令行运行此命令:appium --relaxed-security。然后 appium 让您在测试期间使用不安全的功能。 例如在 pyhton 中你应该运行 os.system(appium --relaxed-security (同时在系统环境变量路径中有 appium 目录。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-04-26
    • 1970-01-01
    • 2018-11-04
    • 2014-05-07
    • 1970-01-01
    • 1970-01-01
    • 2023-01-21
    相关资源
    最近更新 更多