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

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.s
执行下面语句后,设备操作到启动应用后,到点击同意文本元素后报错,执行语句如下: class Super_Douyin_0001: name = '抖音录制短视频-Super_Douyin_0001' def setup(self): package = "com.ss.android.ugc.aweme" activity = "com.ss.android.ugc.aweme.splash.SplashActivity" self.super = SuperappUtils(package, activity) self.driver = self.super.driver self.super.gohome() self.super.activate_app() def teststeps(self): STEP(1, '抖音录制短视频') self.driver.find_element(AppiumBy.ANDROID_UIAUTOMATOR, f'new UiSelector().text("同意")').click() 报错信息如下: [HTTP] --> POST /wd/hub/session/1b13b4e2-f956-4b99-97fa-7ecea17e57cd/element [HTTP] {"using":"-android uiautomator","value":"new UiSelector().text(\"同意\")"} [W3C (1b13b4e2)] Calling AppiumDriver.findElement() with args: ["-android uiautomator","new UiSelector().text(\"同意\")","1b13b4e2-f956-4b99-97fa-7ecea17e57cd"] [BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, css selector, -android uiautomator [BaseDriver] Waiting up to 0 ms for condition [WD Proxy] Matched '/element' to command name 'findElement' [WD Proxy] Proxying [POST /element] to [POST http://127.0.0.1:8202/wd/hub/session/c2419d85-af4b-4231-87c8-b1c10d2c0c85/element] with body: {"strategy":"-android uiautomator","selector":"new UiSelector().text(\"同意\")","context":"","multiple":false} [WD Proxy] socket hang up [W3C (1b13b4e2)] Encountered internal error running command: UnknownError: 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 [W3C (1b13b4e2)] at UIA2Proxy.command (C:\Program Files\Appium\resources\app\node_modules\appium\node_modules\appium-base-driver\lib\jsonwp-proxy\proxy.js:274:13) [W3C (1b13b4e2)] at runMicrotasks () [W3C (1b13b4e2)] at processTicksAndRejections (internal/process/task_queues.js:85:5) [HTTP] <-- POST /wd/hub/session/1b13b4e2-f956-4b99-97fa-7ecea17e57cd/element 500 34 ms - 669
最新发布
07-23
我补充appium运行日志,帮我在进行分析 POST /wd/hub/session/ba55b86b-aefa-4540-8da2-f473942b5355/element [HTTP] {"using":"-android uiautomator","value":"new UiSelector().text(\"交管12123\")"} [W3C (ba55b86b)] Calling AppiumDriver.findElement() with args: ["-android uiautomator","new UiSelector().text(\"交管12123\")","ba55b86b-aefa-4540-8da2-f473942b5355"] [BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, css selector, -android uiautomator [BaseDriver] Waiting up to 0 ms for condition [WD Proxy] Matched '/element' to command name 'findElement' [WD Proxy] Proxying [POST /element] to [POST http://127.0.0.1:8200/wd/hub/session/d2fc0e4a-99bb-42d2-919d-82982ca84b2b/element] with body: {"strategy":"-android uiautomator","selector":"new UiSelector().text(\"交管12123\")","context":"","multiple":false} [WD Proxy] Got response with status 200: {"sessionId":"d2fc0e4a-99bb-42d2-919d-82982ca84b2b","value":{"ELEMENT":"63892df6-d23d-434e-ab08-643cbb42866d","element-6066-11e4-a52e-4f735466cecf":"63892df6-d23d-434e-ab08-643cbb42866d"}} [W3C (ba55b86b)] Responding to client with driver.findElement() result: {"element-6066-11e4-a52e-4f735466cecf":"63892df6-d23d-434e-ab08-643cbb42866d","ELEMENT":"63892df6-d23d-434e-ab08-643cbb42866d"} [HTTP] <-- POST /wd/hub/session/ba55b86b-aefa-4540-8da2-f473942b5355/element 200 64 ms - 137 [HTTP] [BaseDriver] Shutting down because we waited 60 seconds for a command [Appium] Closing session, cause was 'New Command Timeout of 60 seconds expired. Try customizing the timeout using the 'newCommandTimeout' desired capability' [Appium] Removing session 'ba55b86b-aefa-4540-8da2-f473942b5355' from our master session list [UiAutomator2] Deleting UiAutomator2 session [UiAutomator2] Deleting UiAutomator2 server session [WD Proxy] Matched '/' to command name 'deleteSession' [WD Proxy] Proxying [DELETE /] to [DELETE http://127.0.0.1:8200/wd/hub/session/d2fc0e4a-99bb-42d2-919d-82982ca84b2b] with no body [WD Proxy] socket hang up [UiAutomator2] Did not get confirmation UiAutomator2 deleteSession worked; Error was: UnknownError: 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 [Logcat] Stopping logcat capture [ADB] Removing forwarded port socket connection: 8200 [ADB] Running 'D:\python\auto_deploy_hytest\androidsdk\platform-tools\adb.exe -P 5037 -s 4TBBB25326100106 forward --remove tcp:8200' [UiAutomator2] Restoring hidden api policy to the device default configuration [ADB] Running 'D:\python\auto_deploy_hytest\androidsdk\platform-tools\adb.exe -P 5037 -s 4TBBB25326100106 shell 'settings delete global hidden_api_policy_pre_p_apps;settings delete global hidden_api_policy_p_apps;settings delete global hidden_api_policy''
07-11
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值