解决Chromedriver报错Could not proxy command to remote server
报错信息如下:
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,具体如下:
capabilities.setCapability("recreateChromeDriverSessions", true);
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构