在 Appium 中使用 UIAutomatorviewer 测试 Android 应用程序时出错 [英] Error in using UIAutomatorviewer for testing Android app in Appium

查看:42
本文介绍了在 Appium 中使用 UIAutomatorviewer 测试 Android 应用程序时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须自动化一个 Android 应用程序,我正在通过 Appium 做同样的事情.

I have to automate an Android application, I am doing the same through Appium.

我面临的问题是启动 Appium 服务器后,该应用程序安装在模拟器 4.4.2 中.为了检查元素,我使用了 SDK 默认的 UIAutomatorviewer.但是在检查应用程序的元素时,我收到错误:

The problem I am facing is after launching the Appium server, the app is getting installed in the emulator 4.4.2. To inspect the element I am using UIAutomatorviewer which comes default with SDK. But while inspecting the element of the app, I am getting the error:

Error obtaining UI hierarchy
Reason:Error while obtaining UI hierarchy XML file.com.android.ddmlb.SynchException.Remote object doesn't exist.

我试图找到解决方案,以便我可以检查元素以便编写脚本,但徒劳无功.

I tried to find the solution so that I can inspect the element so that I can script, but in vain.

  1. 有人可以告诉我如何解决这个问题,以便我可以检查元素吗?
  2. 除了使用 UIAutomator 查看器之外,还有其他方法可以检查应用中的元素吗?
  1. Can someone please tell how to fix the issue so that I can inspect elements?
  2. Is there any other way I can inspect element in the app apart from using UIAutomator viewer?

推荐答案

在与 uiautomator 查看器幽会之后,我才知道只有在以下情况下才会出现错误:

After my tryst with the uiautomator viewer i came to know that we get the error only when:

appium 服务器正在运行,我们尝试使用 uiautomatorviewer 捕获屏幕截图.

appium server is running and we try to capture the screenshot using uiautomatorviewer.

因此,每当您想使用 uiautomatorviewer 时,请确保服务器处于停止状态.

So, whenever you want to use uiautomatorviewer make sure that server is in stopped state.

这篇关于在 Appium 中使用 UIAutomatorviewer 测试 Android 应用程序时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆