在 Appium 中使用 UIAutomatorviewer 测试 Android 应用程序时出错

编程入门 行业动态 更新时间:2024-10-27 17:14:30
本文介绍了在 Appium 中使用 UIAutomatorviewer 测试 Android 应用程序时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我必须自动化一个 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.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.

有人可以告诉我如何解决这个问题,以便我可以检查元素吗?除了使用 UIAutomator 查看器之外,还有其他方法可以检查应用中的元素吗? Can someone please tell how to fix the issue so that I can inspect elements? 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屋!

更多推荐

[db:关键词]

本文发布于:2023-04-17 19:18:14,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/919102.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:应用程序   测试   Appium   UIAutomatorviewer   Android

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!