報錯信息以下:node
error: Chromedriver: Error: Could not proxy command to remote server. Original e rror: Error: connect ECONNREFUSED 127.0.0.1:9515 at JWProxy.proxy$ (lib/proxy.js:109:13) at tryCatch (D:\Appium\node_modules\appium\node_modules\appium-chromedriver\ node_modules\appium-jsonwp-proxy\node_modules\babel-runtime\regenerator\runtime. js:67:40) at GeneratorFunctionPrototype.invoke [as _invoke] (D:\Appium\node_modules\ap pium\node_modules\appium-chromedriver\node_modules\appium-jsonwp-proxy\node_modu les\babel-runtime\regenerator\runtime.js:315:22) at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (D:\ Appium\node_modules\appium\node_modules\appium-chromedriver\node_modules\appium- jsonwp-proxy\node_modules\babel-runtime\regenerator\runtime.js:100:21) at GeneratorFunctionPrototype.invoke (D:\Appium\node_modules\appium\node_mod ules\appium-chromedriver\node_modules\appium-jsonwp-proxy\node_modules\babel-run time\regenerator\runtime.js:136:37) at bound (domain.js:250:14) at GeneratorFunctionPrototype.runBound (domain.js:263:12) at run (D:\Appium\node_modules\appium\node_modules\appium-chromedriver\node_ modules\appium-jsonwp-proxy\node_modules\babel-runtime\node_modules\core-js\libr ary\modules\es6.promise.js:89:39) at D:\Appium\node_modules\appium\node_modules\appium-chromedriver\node_modul es\appium-jsonwp-proxy\node_modules\babel-runtime\node_modules\core-js\library\m odules\es6.promise.js:100:28 at flush (D:\Appium\node_modules\appium\node_modules\appium-chromedriver\nod e_modules\appium-jsonwp-proxy\node_modules\babel-runtime\node_modules\core-js\li brary\modules\$.microtask.js:17:13) at doNTCallback0 (node.js:407:9) at process._tickDomainCallback (node.js:377:13) [Error: Could not proxy command to remote server. Original error: Error: connec t ECONNREFUSED 127.0.0.1:9515] info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"shutdown"} info: [debug] [BOOTSTRAP] [debug] Got command of type SHUTDOWN info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":"OK, shutting down" ,"status":0} info: [debug] [BOOTSTRAP] [debug] Closed client connection info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: numtests=1 info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=. info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRun ner info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServer info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class=io.appium.andro id.bootstrap.Bootstrap info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: current=1 info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: 0 info: [debug] Sent shutdown command, waiting for UiAutomator to stop... info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream= info: [debug] [UIAUTOMATOR STDOUT] Test results for WatcherResultPrinter=. info: [debug] [UIAUTOMATOR STDOUT] Time: 178.718 info: [debug] [UIAUTOMATOR STDOUT] OK (1 test) info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: -1 info: [debug] UiAutomator shut down normally info: [debug] Cleaning up android objects info: [debug] Cleaning up appium session info: [debug] We shut down because no new commands came in
解決辦法: appium的配置裏設置recreateChromeDriverSessions爲true,具體以下:android
capabilities.setCapability("recreateChromeDriverSessions", true);es6