本文介绍了使用UIAutomatorviewer在Appium中测试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.

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

10-16 21:43