Android UiAutomation未连接! Appium 1.17.1-1

问题描述 投票:1回答:1

我们正在尝试使用以下功能进行Appium会话。

[debug] [35m[BaseDriver] [39m "deviceName": "8C4Y14QBGA",
[debug] [35m[BaseDriver] [39m "newCommandTimeout": "1800",
[debug] [35m[BaseDriver] [39m "automationName": "UiAutomator2",
[debug] [35m[BaseDriver] [39m "app": "/process/uploads/20200609131058_nqx3Q.apk",
[debug] [35m[BaseDriver] [39m "platformName": "android",
[debug] [35m[BaseDriver] [39m "platformVersion": "9",
[debug] [35m[BaseDriver] [39m "connectHardwareKeyboard": "true"

[我们正在使用Java Appium客户端库来创建具有上述功能的会话,并且在截取屏幕截图“ UiAutomation未连接!”时遇到错误。

这里是Appium错误日志。

[debug] [35m[MJSONWP (3128a38e)][39m Calling AppiumDriver.getScreenshot() with args: ["3128a38e-d465-4c28-bba5-f9977abd4150"]
[debug] [35m[WD Proxy][39m Matched '/screenshot' to command name 'getScreenshot'
[debug] [35m[WD Proxy][39m Proxying [GET /screenshot] to [GET http://127.0.0.1:8200/wd/hub/session/be4490f0-7be9-48cd-bcae-6a32ed9359c0/screenshot] with no body[35m[WD Proxy][39m Got response with status 500: {"sessionId":"be4490f0-7be9-48cd-bcae-6a32ed9359c0","value":{"error":"unknown error","message":"java.lang.IllegalStateException: UiAutomation not connected!","stacktrace":"java.lang.IllegalStateException: UiAutomation not connected!\n\tat android.app.UiAutomation.throwIfNotConnectedLocked(UiAutomation.java:1112)\n\tat android.app.UiAutomation.takeScreenshot(UiAutomation.java:709)\n\tat io.appium.uiautomator2.utils.ScreenshotHelper.takeDeviceScreenshot(Unknown Source:169)\n\tat io.appium.uiautomator2.utils.ScreenshotHelper.takeScreenshot(Unknown Source:7)\n\tat io.appium.uiautomator2.utils.ScreenshotHelper.takeScreenshot(Unknown Source:1)\n\tat io.appium.uiautomator2.handler.CaptureScreenshot.safeHandle(Unknown Source:11)\n\tat io.appium.uiautomator2.handler.request.SafeRequestHandler.handle(Unknown Source:0)\n\tat io.appium.uiautomator2.server.AppiumServlet.handleRequest(Unknown Source:23)\n\tat io.appium.uiautomator2.server.AppiumServlet.handleHttpRequest(Unknown Source:57)\n\tat io.appium.uiautomator2.ht...
[debug] [35m[W3C][39m Matched W3C error code 'unknown error' to UnknownError
[debug] [35m[MJSONWP (3128a38e)][39m Encountered internal error running command: An unknown server-side error occurred while processing the command. Original error: java.lang.IllegalStateException: UiAutomation not connected!
[debug] [35m[MJSONWP (3128a38e)][39m java.lang.IllegalStateException: UiAutomation not connected!
appium android-testing android-uiautomator
1个回答
0
投票
    如果出于安全目的为您的应用启用了FLAG_SECURE,则应用不会拍摄屏幕快照。要求开发人员为您提供禁用设置的应用。
  1. 此外,要消除最新的appium版本1.17.1-1出现问题的可能性,请尝试使用appium v​​1.16.0版进行屏幕截图并分享您的结果。
© www.soinside.com 2019 - 2024. All rights reserved.