Appium 自动测试为什么总是退出去呢?sleep 时间有关系吗

skyshine · 2021年07月24日 · 最后由 Time 回复于 2021年07月28日 · 3627 次阅读
[MJSONWP (1a0f5cff)] Responding to client with driver.click() result: null
[HTTP] <-- POST /wd/hub/session/1a0f5cff-3678-42b9-b1eb-f1532f2e19c1/element/45f425af-ce14-4dd1-95cf-5ba0b2d07aa1/click 200 1161 ms - 76
[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 '1a0f5cff-3678-42b9-b1eb-f1532f2e19c1' 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:8201/wd/hub/session/ffe16cbf-285d-4d2c-91b5-d0f964e4136b] 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
[UiAutomator2] Resetting IME to 'io.appium.settings/.UnicodeIME'
[ADB] Running 'E:\android_sdk\platform-tools\adb.exe -P 5037 -s 127.0.0.1:21513 shell ime set io.appium.settings/.UnicodeIME'
[ADB] Running 'E:\android_sdk\platform-tools\adb.exe -P 5037 -s 127.0.0.1:21513 shell am force-stop com.tencent.mm'
[Logcat] Stopping logcat capture
[ADB] Removing forwarded port socket connection: 8201 
[ADB] Running 'E:\android_sdk\platform-tools\adb.exe -P 5037 -s 127.0.0.1:21513 forward --remove tcp:8201'
==============================================================================================================
[MJSONWP (980adcad)] Responding to client with driver.click() result: null
[HTTP] <-- POST /wd/hub/session/980adcad-d8f6-47cf-aa48-e62aace232d5/element/458336c6-fc31-4cd5-aa8b-41eded34d336/click 200 187 ms - 76
[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 '980adcad-d8f6-47cf-aa48-e62aace232d5' 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:8202/wd/hub/session/014af5c0-5610-4de5-97ee-527833c782b0] with no body
[WD Proxy] Got response with status 200: {"sessionId":"014af5c0-5610-4de5-97ee-527833c782b0","value":null}
[UiAutomator2] Resetting IME to 'io.appium.settings/.UnicodeIME'
[ADB] Running 'E:\android_sdk\platform-tools\adb.exe -P 5037 -s 127.0.0.1:21513 shell ime set io.appium.settings/.UnicodeIME'
[Instrumentation] .
[Instrumentation] Time: 143.155
[Instrumentation] 
[Instrumentation] OK (1 test)
[Instrumentation] The process has exited with code 0
[ADB] Running 'E:\android_sdk\platform-tools\adb.exe -P 5037 -s 127.0.0.1:21513 shell am force-stop com.tencent.mm'
[Logcat] Stopping logcat capture
[ADB] Removing forwarded port socket connection: 8202 
[ADB] Running 'E:\android_sdk\platform-tools\adb.exe -P 5037 -s 127.0.0.1:21513 forward --remove tcp:8202'
====================================================================================================================
[MJSONWP (c4102501)] Responding to client with driver.click() result: null
[HTTP] <-- POST /wd/hub/session/c4102501-817e-47eb-acbb-aac95b700611/element/d0c171b6-2151-47a1-9fc6-937185ae9498/click 200 405 ms - 76
[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 'c4102501-817e-47eb-acbb-aac95b700611' 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:8203/wd/hub/session/e38f703f-a614-4234-87ae-a541d8159299] with no body
[WD Proxy] Got response with status 200: {"sessionId":"e38f703f-a614-4234-87ae-a541d8159299","value":null}
[UiAutomator2] Resetting IME to 'io.appium.settings/.UnicodeIME'
[ADB] Running 'E:\android_sdk\platform-tools\adb.exe -P 5037 -s 127.0.0.1:21513 shell ime set io.appium.settings/.UnicodeIME'
[Instrumentation] .
[Instrumentation] Time: 164.41
[Instrumentation] 
[Instrumentation] OK (1 test)
[Instrumentation] The process has exited with code 0
[ADB] Running 'E:\android_sdk\platform-tools\adb.exe -P 5037 -s 127.0.0.1:21513 shell am force-stop com.tencent.mm'
[Logcat] Stopping logcat capture
[ADB] Removing forwarded port socket connection: 8203 
[ADB] Running 'E:\android_sdk\platform-tools\adb.exe -P 5037 -s 127.0.0.1:21513 forward --remove tcp:8203'

这是三次退出时 appium 给出的一段信息。
每次都是 按钮 click() 成功后,过一会儿就会退出。
不明白是为什么

中间 sleep 的时间长了吗?

共收到 5 条回复 时间 点赞

后台被杀了吧,添加到后台白名单

后台被 杀了什么意思 ?模拟器把 app 杀了?。 怎么添加到白名单

[Appium] Closing session, cause was 'New Command Timeout of 60 seconds expired. Try customizing the timeout using the 'newCommandTimeout' desired capability'

这条日志你看一下?里面写得很清晰了。

# 这打出去是以及标题?
## 这打出去是二级小标题?

传参加上 "newCommandTimeout": 6000

需要 登录 后方可回复, 如果你还没有账号请点击这里 注册