无法获取当应用程序在设备上运行的uiautomator工具上的元素 [英] Unable to get the elements in uiautomator tool when the app is running on the device

查看:734
本文介绍了无法获取当应用程序在设备上运行的uiautomator工具上的元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个设置,其中在我的电脑的Web应用程序正在访问应用程序的信息连接的设备上运行。(通过USB调试)。和应用程序的数据不断地发送到Web应用程序(PC)。

I am having a setup where web Application in my PC is accessing the app info running on the connected device.(through USB debugging). and continuously sends the app data to the Web Application(PC).

我为我的自动化测试自动化,这一点使用硒(网页GUI)和appium(设备)。

I am automating this using selenium(web GUI) and appium(device) for my automation testing..

问题:我无法从uiautomator.bat工具连接到该设备一旦应用程序在设备得到推出,并与Web应用程序通信(在我的电脑)。
提示以下错误:。是否有此问题的解决方法。

Issue: I am unable to connect to the device from uiautomator.bat tool once the app is getting launched in the device and communicating with the Web app(In my PC). Getting the below error. Is there a workaround for this issue.

-------- uiautomator.bat日志-----------

--------uiautomator.bat log-----------

C:\\用户\\ sat_yug \\ Android的软件开发工具包\\工具> uiautomatorviewer.bat
三时57分35秒E /设备监视器:ADB连接错误:一个现有的连接被强行关闭远程主机
3点57分36秒E /设备监视器:连接尝试:1
3时57分38秒E /设备监视器:连接尝试:2
三时57分40秒E /设备监视器:连接尝试:3
3点57分42秒E /设备监视器:连接尝试:4
3点57分44秒E /设备监视器:连接尝试:5
3时58分04秒E /设备监视器:ADB连接错误:一个现有的连接被强行关闭远程主机

C:\Users\sat_yug\android-sdks\tools>uiautomatorviewer.bat 03:57:35 E/DeviceMonitor: Adb connection Error:An existing connection was forcibly closed by the remote host 03:57:36 E/DeviceMonitor: Connection attempts: 1 03:57:38 E/DeviceMonitor: Connection attempts: 2 03:57:40 E/DeviceMonitor: Connection attempts: 3 03:57:42 E/DeviceMonitor: Connection attempts: 4 03:57:44 E/DeviceMonitor: Connection attempts: 5 03:58:04 E/DeviceMonitor: Adb connection Error:An existing connection was forcibly closed by the remote host

------------ ADB设备登录---------------------

------------adb devices log---------------------

C:\\用户\\ sat_yug \\ Android的软件开发工具包\\平台工具> ADB设备
设备名单附后
ADB服务器已过期。杀...
错误:无法安装的的SmartSocket 的监听器:无法绑定到127.0.0.1:5037:只有每个套接字地址的一个用法(协议/ N
etwork地址/端口)通常是允许的。 (10048)
无法读取从亚洲开发银行服务器确定
*未能启动守护*
错误:无法连接到守护程序

C:\Users\sat_yug\android-sdks\platform-tools>adb devices List of devices attached adb server is out of date. killing... error: could not install smartsocket listener: cannot bind to 127.0.0.1:5037: Only one usage of each socket address (protocol/n etwork address/port) is normally permitted. (10048) could not read ok from ADB Server * failed to start daemon * error: cannot connect to daemon

推荐答案

根据答案<一个href=\"http://stackoverflow.com/questions/17556011/an-existing-connection-was-forcibly-closed-by-the-remote-host-in-eclipse\">THIS问题,还有就是你可能已经安装了亚行的两个版本的可能性。

As per the answer to THIS question, there is a possibility that you could have two versions of adb installed.

请尝试以下(从同一岗位报之以检查是否有多个版本),摆脱不必要的一个。

Try the following (quoted from same post to check if there are multiple versions) and get rid of the unwanted one.

在这里adb.exe

where adb.exe

您可以尝试另一种选择是杀错点之前,或在您的批处理文件的执行开始启动ADB服务器。

Another option you could try is to kill and start the adb server before the point of error or at the start of execution of your batch file.

adb kill-server
adb start-server
....
....
//your script here
....
....

这篇关于无法获取当应用程序在设备上运行的uiautomator工具上的元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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