Appium: Could not proxy command to the remote server. Original error: socket hang up

5 篇文章 0 订阅
3 篇文章 0 订阅

1、错误信息:

selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to the remote server. Original error: socket hang up

 

2、解决方案:

在手机/模拟器上,卸载Appium相关的安装包:

 

可以通过命令查找需要卸载哪些包:

adb shell pm list package -f | grep appium
package:/data/app/~~oPez7rjlE3FwyT7j2m1XEA==/io.appium.settings-qYRwcTI46IQqXcA5z0efbw==/base.apk=io.appium.settings
package:/data/app/~~wdEzJWutSog6gHk1DKM_DQ==/io.appium.uiautomator2.server-aTlAPDnePzkrrh6KV7-7wQ==/base.apk=io.appium.uiautomator2.server
package:/data/app/~~8RPJlBld5zy3JwAiN2zU7Q==/io.appium.uiautomator2.server.test-q-QfMCQLSoStDAAWOyzGlQ==/base.apk=io.appium.uiautomator2.server.test

adb命令卸载:

adb -s emulator-5554 uninstall io.appium.settings
adb -s emulator-5554 uninstall io.appium.uiautomator2.server
adb -s emulator-5554 uninstall io.appium.uiautomator2.server.test

#如果有就删掉
adb -s emulator-5554 uninstall io.appium.android.apis

重启Appium,OK。

 

3、出现原因:

简单的说:上一个自动化开启的socket没有关闭,就执行了下一个新的,上一个socket 挂起了,无法执行下一个。

httpserver进程被上一次自动化一直占用:socket hang up
这种一般是请求超时:
node.js提供的httpserver默认会设置超时时间为2分钟。请求超时就会被socket关闭掉。
客户端就会收到ECONNRESET的错误.有可能是httpserver进程被上一次自动化一直占用着,就会导致已运行就报错.
所以appium也有自动结束进程,只要脚本运行完成后就会自动结束app的进程,防止下次运行进程被占用.
appium会在脚本结束的时候自动杀掉所有进程,脚本运行完成以后,你通过appium打开的app会在一段时间后自动关闭,防止下次运行被占用,导致报错。

4、问题场景:

自动化case在执行过程中,又通过命令行人为构造http协议发起了元素定位获取点击等操作,反复多次。

 

参考:

https://www.jianshu.com/p/4405184be65d

https://testerhome.com/topics/10913

https://blog.csdn.net/xgh1951/article/details/90606159

https://www.jianshu.com/p/adc685d0ce15

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值