环境:
在自动化测试期间,当在Android模拟器上运行时,Appium一直停滞不前。
很少有测试因为问题而失败似乎是服务器问题:
的例外:
" org.openqa.selenium.WebDriverException:未知的服务器端错误 处理命令时发生。原始错误:无法停止 处理;它目前没有运行"
有没有任何已知方法可以避免此问题?
以下是来自Appium服务器的更多堆栈跟踪:
[debug] [ADB] Running ‘…/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell am force-stop com.go.android'[debug] [ADB] Pressing the HOME button
[debug] [ADB] Getting connected devices...[debug] [ADB] Pressing the HOME button
[debug] [ADB] Getting connected devices...[debug] [AndroidBootstrap] Sending command to android: {"cmd":"shutdown"}[debug] [AndroidBootstrap] Sending command to android: {"cmd":"shutdown"}
[debug] [AndroidBootstrap] Received command result from bootstrap
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {"cmd":"shutdown"}
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type SHUTDOWN
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {"status":0,"value":"OK, shutting down"}
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Closed client connection
[debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: numtests=1
[debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: stream=.
[debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
[debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: test=testRunServer
[debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap
[debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: current=1
[debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS_CODE: 0
[debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: stream=
[debug] [AndroidBootstrap] [UIAUTO STDOUT] Test results for WatcherResultPrinter=.
[debug] [AndroidBootstrap] [UIAUTO STDOUT] Time: 52.015
[debug] [AndroidBootstrap] [UIAUTO STDOUT] OK (1 test)
[debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS_CODE: -1
[error] [UiAutomator] UiAutomator exited unexpectedly with code 0, signal null
[debug] [UiAutomator] Moving to state 'stopped'
[debug] [UiAutomator] Shutting down UiAutomator
[debug] [UiAutomator] Moving to state 'stopping'
[error] [Appium] Had trouble ending session fc510427-6374-4d94-83b4-f008e05f8d69: Can't stop process; it's not currently running (cmd: ‘/…/Library/Android/sdk/platform-tools/adb')
[error] [MJSONWP] Encountered internal error running command: Error: Can't stop process; it's not currently running (cmd: '/Users/Library/Android/sdk/platform-tools/adb')
看起来它失败了退出应用时使用' HOME'按钮。
答案 0 :(得分:0)
使用'允许会话覆盖'运行测试时发生此问题。 关闭此选项,测试不再失败(超过500次)测试,所以我的结论是这个选项导致了这个问题。