您的位置:首页 > 移动开发

appium 切换到 webview 下,执行 webview 下的第二次操作时,proxying chromedriver 的 session 请求无响应

2017-06-12 17:25 1271 查看
转载地址:https://testerhome.com/topics/6279

今天执行碰到个问题,简单地说就是

appium切换到webview下,在webview下执行第二个点击操作时操作时,appium session 去proxying到chromedriver的session时请求无响应。

相关信息如下:

设备:OPPO R7

appium版本:1.5.3

chromedriver版本:2.25

client版本:java_client 4.1

app内置浏览器内核:据开发说是改为了TX的x5内核

日志如下(从切换webview开始,到最后请求无响应结束的所有日志)

2016-11-02 16:51:48:343 - [debug] [AndroidDriver] from: u0_a384,25454,249,1506648,220112,ffffffff,00000000,S,com.aixuedai.axd
2016-11-02 16:51:48:343 - [debug] [AndroidDriver] returning process name: com.aixuedai.axd
2016-11-02 16:51:48:343 - [debug] [AndroidDriver] Found webviews: ["WEBVIEW_com.aixuedai.axd"]
2016-11-02 16:51:48:343 - [debug] [AndroidDriver] Available contexts: ["NATIVE_APP","WEBVIEW_com.aixuedai.axd"]
2016-11-02 16:51:48:343 - [MJSONWP] Responding to client with driver.getContexts() result: ["NATIVE_APP","WEBVIEW_com....
2016-11-02 16:51:48:343 - [HTTP] <-- GET /wd/hub/session/59646e68-67b3-49d1-b89a-73b075a9113e/contexts 200 226 ms - 113
2016-11-02 16:51:48:359 - [HTTP] --> POST /wd/hub/session/59646e68-67b3-49d1-b89a-73b075a9113e/context {"name":"WEBVIEW_com.aixuedai.axd"}
2016-11-02 16:51:48:359 - [MJSONWP] Calling AppiumDriver.setContext() with args: ["WEBVIEW_com.aixuedai.axd"...
2016-11-02 16:51:48:359 - [debug] [AndroidDriver] Getting a list of available webviews
2016-11-02 16:51:48:359 - [debug] [ADB] Getting connected devices...
2016-11-02 16:51:48:375 - [debug] [ADB] 1 device(s) connected
2016-11-02 16:51:48:375 - [debug] [ADB] Running D:\Tools\android-sdk-windows\platform-tools\adb.exe with args: ["-P",5037,"-s","KZZLQSPNKZGEVWK7","shell","cat","/proc/net/unix"]
2016-11-02 16:51:48:422 - [debug] [AndroidDriver] WEBVIEW_25454 mapped to pid 25454
2016-11-02 16:51:48:422 - [debug] [AndroidDriver] Getting process name for webview
2016-11-02 16:51:48:422 - [debug] [ADB] Getting connected devices...
2016-11-02 16:51:48:437 - [debug] [ADB] 1 device(s) connected
2016-11-02 16:51:48:437 - [debug] [ADB] Running D:\Tools\android-sdk-windows\platform-tools\adb.exe with args: ["-P",5037,"-s","KZZLQSPNKZGEVWK7","shell","ps"]
2016-11-02 16:51:48:547 - [debug] [AndroidDriver] Parsed pid: 25454 pkg: com.aixuedai.axd!
2016-11-02 16:51:48:547 - [debug] [AndroidDriver] from: u0_a384,25454,249,1508984,221296,ffffffff,00000000,S,com.aixuedai.axd
2016-11-02 16:51:48:547 - [debug] [AndroidDriver] returning process name: com.aixuedai.axd
2016-11-02 16:51:48:547 - [debug] [AndroidDriver] Found webviews: ["WEBVIEW_com.aixuedai.axd"]
2016-11-02 16:51:48:547 - [debug] [AndroidDriver] Available contexts: ["NATIVE_APP","WEBVIEW_com.aixuedai.axd"]
2016-11-02 16:51:48:547 - [debug] [AndroidDriver] Connecting to chrome-backed webview context 'WEBVIEW_com.aixuedai.axd'
2016-11-02 16:51:48:547 - [debug] [Chromedriver] Changed state to 'starting'
2016-11-02 16:51:48:625 - [Chromedriver] Set chromedriver binary as: C:\Users\hwb\AppData\Roaming\npm\node_modules\appium\node_modules\appium-android-driver\node_modules\appium-chromedriver\chromedriver\win\chromedriver.exe
2016-
4000
11-02 16:51:48:625 - [Chromedriver] Killing any old chromedrivers, running: FOR /F "usebackq tokens=5" %a in (`netstat -nao ^| findstr /R /C:"9515 "`) do (FOR /F "usebackq" %b in (`TASKLIST /FI "PID eq %a" ^| findstr /I chromedriver.exe`) do (IF NOT %b=="" TASKKILL /F /PID %a))
2016-11-02 16:51:48:703 - [Chromedriver] No old chromedrivers seemed to exist
2016-11-02 16:51:48:719 - [Chromedriver] Spawning chromedriver with: C:\Users\hwb\AppData\Roaming\npm\node_modules\appium\node_modules\appium-android-driver\node_modules\appium-chromedriver\chromedriver\win\chromedriver.exe --url-base=wd/hub --port=9515 --adb-port=5037
2016-11-02 16:51:49:063 - [Chromedriver] [STDOUT] Starting ChromeDriver 2.25.426923 (0390b88869384d6eb0d5d09729679f934aab9eed) on port 9515
Only local connections are allowed.
2016-11-02 16:51:49:078 - [JSONWP Proxy] Proxying [GET /status] to [GET http://127.0.0.1:9515/wd/hub/status] with no body
2016-11-02 16:51:49:094 - [JSONWP Proxy] Got response with status 200: "{\"sessionId\":\"\",\"stat...
2016-11-02 16:51:49:094 - [JSONWP Proxy] Proxying [POST /session] to [POST http://127.0.0.1:9515/wd/hub/session] with body: {"desiredCapabilities":{"ch...
2016-11-02 16:51:51:735 - [JSONWP Proxy] Got response with status 200: {"sessionId":"c6856afd440d4...
2016-11-02 16:51:51:751 - [debug] [Chromedriver] Changed state to 'online'
2016-11-02 16:51:51:751 - [MJSONWP] Responding to client with driver.setContext() result: null
2016-11-02 16:51:51:751 - [HTTP] <-- POST /wd/hub/session/59646e68-67b3-49d1-b89a-73b075a9113e/context 200 3396 ms - 76
2016-11-02 16:51:54:783 - [HTTP] --> POST /wd/hub/session/59646e68-67b3-49d1-b89a-73b075a9113e/execute {"script":"document.getElementById('J_go').click()","args":[]}
2016-11-02 16:51:54:783 - [MJSONWP] Driver proxy active, passing request on via HTTP proxy
2016-11-02 16:51:54:783 - [JSONWP Proxy] Proxying [POST /wd/hub/session/59646e68-67b3-49d1-b89a-73b075a9113e/execute] to [POST http://127.0.0.1:9515/wd/hub/session/c6856afd440d4877fdb0c07ee0303108/execute] with body: {"script":"document.getElem...
2016-11-02 16:51:54:970 - [JSONWP Proxy] Got response with status 200: {"sessionId":"c6856afd440d4...
2016-11-02 16:51:54:970 - [JSONWP Proxy] Replacing sessionId c6856afd440d4877fdb0c07ee0303108 with 59646e68-67b3-49d1-b89a-73b075a9113e
2016-11-02 16:51:54:970 - [HTTP] <-- POST /wd/hub/session/59646e68-67b3-49d1-b89a-73b075a9113e/execute 200 197 ms - 76
2016-11-02 16:51:58:018 - [HTTP] --> POST /wd/hub/session/59646e68-67b3-49d1-b89a-73b075a9113e/execute {"script":"document.getElementById('J_Submit').click()","args":[]}
2016-11-02 16:51:58:018 - [MJSONWP] Driver proxy active, passing request on via HTTP proxy
2016-11-02 16:51:58:018 - [JSONWP Proxy] Proxying [POST /wd/hub/session/59646e68-67b3-49d1-b89a-73b075a9113e/execute] to [POST http://127.0.0.1:9515/wd/hub/session/c6856afd440d4877fdb0c07ee0303108/execute] with body: {"script":"document.getElem...

可以看到,执行到最后的

2016-11-02 16:51:58:018 - [JSONWP Proxy] Proxying [POST /wd/hub/session/59646e68-67b3-49d1-b89a-73b075a9113e/execute] to [POSThttp://127.0.0.1:9515/wd/hub/session/c6856afd440d4877fdb0c07ee0303108/execute]
with body: {"script":"document.getElem...

这一步后,就再没有收到相应的response,日志没有报错,运行的client脚本也没报错,一直处于运行状态,相关的java代码如下:
//调用封装的切换webvie方法切换到webview模式:
appcomm.switchToWebView(driver);

//webview模式下操作app
jse.executeScript("document.getElementById('J_go').click()");
logger.info("****");
comm.forceWaiting(3000);
jse.executeScript("document.getElementById('J_Submit').click()");
logger.info("****");

奇怪的是,执行第一步

jse.executeScript("document.getElementById('J_go').click()");

可以正常执行,但是执行第二步

jse.executeScript("document.getElementById('J_Submit').click()");

就无响应。请各位大神指教。
问题更新

等待5分钟后,appium终于排除异常,如下:
2016-11-02 17:26:58:101 - [BaseDriver] Shutting down because we waited 300 seconds for a command
2016-11-02 17:26:58:106 - [debug] [AndroidDriver] Shutting down Android driver
2016-11-02 17:26:58:109 - [Appium] Closing session, cause was 'New Command Timeout of 300 seconds expired. Try customizing the timeout using the 'newCommandTimeout' desired capability'
2016-11-02 17:26:58:110 - [Appium] Removing session 59646e68-67b3-49d1-b89a-73b075a9113e from our master session list
2016-11-02 17:26:58:116 - [debug] [AndroidDriver] Stopping chromedriver for context WEBVIEW_com.aixuedai.axd
2016-11-02 17:26:58:119 - [debug] [Chromedriver] Changed state to 'stopping'
2016-11-02 17:26:58:123 - [JSONWP Proxy] Proxying [DELETE /] to [DELETE http://127.0.0.1:9515/wd/hub/session/c6856afd440d4877fdb0c07ee0303108] with no body
2016-11-02 17:26:58:225 - [MJSONWP] Encountered internal error running command: Error: Could not proxy. Proxy error: New Command Timeout of 300 seconds expired. Try customizing the timeout using the 'newCommandTimeout' desired capability
at doJwpProxy$ (lib/mjsonwp/mjsonwp.js:329:11)
at tryCatch (C:\Users\hwb\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (C:\Users\hwb\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (C:\Users\hwb\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:100:21)
at GeneratorFunctionPrototype.invoke (C:\Users\hwb\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:136:37)
at process._tickCallback (internal/process/next_tick.js:103:7)
2016-11-02 17:31:58:115 - [Chromedriver] [STDERR] [2409.039][SEVERE]: Timed out receiving message from renderer: 600.000


好了,可以断定就是proxy的问题。

依然请教各位大神!

「保留所有权利,禁止转载」



TesterHome 为用户提供「保留所有权利,禁止转载」的选项。 除非获得原作者的单独授权,任何第三方不得转载标注了「保留所有权利,禁止转载」的内容,否则均视为侵权。 具体请参见TesterHome 知识产权保护协议

共收到 19 条回复





jinjun0620 · #1 · 2016年11月02日

这个我也遇到过,webview自动化的时候,你打开chrome的inspect功能就没事儿。

chrome://inspect





darkmanno6 · #2 · 2016年11月03日

#1楼 @jinjun0620 是的chrome的调试工具是可以识别该页面的,但是卡住的这个时候去点击inspect会解析不了页面,提示冲突





jinjun0620 · #3 · 2016年11月03日

@darkmanno6 启动自动化之前一直打开inspect的话就不会出现无响应的现象。(我是这样解决的)





darkmanno6 · #4 · 2016年11月03日

#3楼 @jinjun0620 还是不行,没有用。





jira · #5 · 2016年11月28日

楼主解决了吗? 我也出现了,第二次进入webview





darkmanno6 · #6 · 2016年11月28日

#5楼 @jira 没有解决,估计和设备有关,我换了设备就可以了,你可以试试。





jira · #7 · 2016年11月30日

#6楼 @darkmanno6 你换的手机是什么版本的?





janez · #8 · 2016年12月05日

我额遇到同样的问题





darkmanno6 · #9 · 2017年01月18日

#7楼 @jira 华为荣耀6.





happymff · #10 · 2017年02月09日

您好,我也是appium切换webview后,进入url后再次点击链接,进入第二页面的url后没有反应,此时使用代码: System.out.println(driver.getCurrentUrl());一直没有响应,知道最后timeout了。貌似加载到第二页的url后,chromedriver不能获取body的信息,导致这个页面加载失败。有人解决这个类似的问题么?
timeout之前显示错误信息:

[debug] [ADB] Getting connected devices...

[debug] [ADB] 1 device(s) connected

[debug] [ADB] Running '/Users/mff/Desktop/workspace/android-sdk-macosx/platform-tools/adb' with args: ["-P",5037,"-s","57b51c43","shell","ps"]

[debug] [ADB] 1 device(s) connected

[debug] [ADB] Running '/Users/mff/Desktop/workspace/android-sdk-macosx/platform-tools/adb' with args: ["-P",5037,"-s","57b51c43","shell","ps"]

[debug] [ADB] 1 device(s) connected

[debug] [ADB] Running '/Users/mff/Desktop/workspace/android-sdk-macosx/platform-tools/adb' with args: ["-P",5037,"-s","57b51c43","shell","ps"]

[debug] [AndroidDriver] Parsed pid: 16121 pkg: com.tencent.mm:tools!

[debug] [AndroidDriver] from: u0_a124,16121,466,1701652,157084,ffffffff,00000000,S,com.tencent.mm:tools

[debug] [AndroidDriver] returning process name: com.tencent.mm:tools

[debug] [AndroidDriver] Parsed pid: 23591 pkg: com.android.browser!

[debug] [AndroidDriver] from: u0_a2,23591,466,1191136,66424,ffffffff,00000000,S,com.android.browser

[debug] [AndroidDriver] returning process name: com.android.browser

[debug] [AndroidDriver] Parsed pid: 20021 pkg: com.android.quicksearchbox!

[debug] [AndroidDriver] from: u0_a80,20021,465,1992180,93528,ffffffff,00000000,S,com.android.quicksearchbox

[debug] [AndroidDriver] returning process name: com.android.quicksearchbox

[debug] [AndroidDriver] Found webviews: ["WEBVIEW_com.android.browser","WEBVIEW_com.tencent.mm:tools","WEBVIEW_com.android.quicksearchbox"]

[debug] [AndroidDriver] Available contexts: ["NATIVE_APP","WEBVIEW_com.android.browser","WEBVIEW_com.tencent.mm:tools","WEBVIEW_com.android.quicksearchbox"]

[debug] [AndroidDriver] Connecting to chrome-backed webview context 'WEBVIEW_com.tencent.mm:tools'

[debug] [AndroidDriver] A port was not given, using random port: 8002

[debug] [Chromedriver] Changed state to 'starting'

[Chromedriver] Set chromedriver binary as: /usr/local/lib/node_modules/appium/node_modules/.2.10.0@appium-chromedriver/chromedriver/mac/chromedriver

[Chromedriver] Killing any old chromedrivers, running: pkill -15 -f "/usr/local/lib/node_modules/appium/node_modules/.2.10.0@appium-chromedriver/chromedriver/mac/chromedriver.*--port=8002"

[Chromedriver] No old chromedrivers seemed to exist

[Chromedriver] Spawning chromedriver with: /usr/local/lib/node_modules/appium/node_modules/.2.10.0@appium-chromedriver/chromedriver/mac/chromedriver --url-base=wd/hub --port=8002 --adb-port=5037

[Chromedriver] [STDOUT] Starting ChromeDriver 2.26.436421 (6c1a3ab469ad86fd49c8d97ede4a6b96a49ca5f6) on port 8002

Only local connections are allowed.

[debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8002/wd/hub/status]
with no body

[debug] [JSONWP Proxy] Got response with status 200: "{\"sessionId\":\"\",\"status\":0,\"value\":{\"build\":{\"version\":\"alpha\"},\"os\":{\"arch\":\"x86_64\",\"name\":\"Mac OS X\",\"version\":\"10.12.3\"}}}"

[debug] [JSONWP Proxy] Proxying [POST /session] to [POST http://127.0.0.1:8002/wd/hub/session]
with body: {"desiredCapabilities":{"chromeOptions":{"androidPackage":"com.tencent.mm","androidUseRunningApp":true,"args":[],"extensions":[],"androidProcess":"com.tencent.mm:tools","androidDeviceSerial":"57b51c43"}}}

[debug] [JSONWP Proxy] Got response with status 200: {"sessionId":"bb37a650bdf7b09a3af75a32e9d6247d","status":0,"value":{"acceptSslCerts":true,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"browserName":"chrome","chrome":{"chromedriverVersion":"2.26.436421
(6c1a3ab469ad86fd49c8d97ede4a6b96a49ca5f6)"},"cssSelectorsEnabled":true,"databaseEnabled":false,"handlesAlerts":true,"hasTouchScreen":true,"javascriptEnabled":true,"locationContextEnabled":true,"mobileEmulationEnabled":false,"nativeEvents":true,"pageLoadStrategy":"normal","platform":"ANDROID","rotatable":false,"takesHeapSnapshot":true,"takesScreenshot":true,"unexpectedAlertBehaviour":"","version":"53.0.2785.49","webStorageEnabled":true}}

[debug] [Chromedriver] Changed state to 'online'

[debug] [MJSONWP] Responding to client with driver.setContext() result: null

[HTTP] <-- POST /wd/hub/session/26554ee3-1ce5-4e52-9773-54db34ebcaea/context 200 609 ms - 76 

[HTTP] --> GET /wd/hub/session/26554ee3-1ce5-4e52-9773-54db34ebcaea/url {}

[MJSONWP] Driver proxy active, passing request on via HTTP proxy

[debug] [JSONWP Proxy] Proxying [GET /wd/hub/session/26554ee3-1ce5-4e52-9773-54db34ebcaea/url] to [GET http://127.0.0.1:8002/wd/hub/session/bb37a650bdf7b09a3af75a32e9d6247d/url]
with body: {}

[debug] [JSONWP Proxy] Got response with status 200: "{\"sessionId\":\"bb37a650bdf7b09a3af75a32e9d6247d\",\"status\":0,\"value\":\"https://h5.koudaitong.com/v2/common/error/closed?kdt_id=512479\"}"

[JSONWP Proxy] Replacing sessionId bb37a650bdf7b09a3af75a32e9d6247d with 26554ee3-1ce5-4e52-9773-54db34ebcaea

[HTTP] <-- GET /wd/hub/session/26554ee3-1ce5-4e52-9773-54db34ebcaea/url 200 78 ms - 136 

[HTTP] --> GET /wd/hub/session/26554ee3-1ce5-4e52-9773-54db34ebcaea/window_handle {}

[MJSONWP] Driver proxy active, passing request on via HTTP proxy

[debug] [JSONWP Proxy] Proxying [GET /wd/hub/session/26554ee3-1ce5-4e52-9773-54db34ebcaea/window_handle] to [GET http://127.0.0.1:8002/wd/hub/session/bb37a650bdf7b09a3af75a32e9d6247d/window_handle]
with body: {}

[debug] [JSONWP Proxy] Got response with status 200: "{\"sessionId\":\"bb37a650bdf7b09a3af75a32e9d6247d\",\"status\":0,\"value\":\"CDwindow-e24c7eee-f6f0-4a6b-9f17-afb56624c460\"}"

[JSONWP Proxy] Replacing sessionId bb37a650bdf7b09a3af75a32e9d6247d with 26554ee3-1ce5-4e52-9773-54db34ebcaea

[HTTP] <-- GET /wd/hub/session/26554ee3-1ce5-4e52-9773-54db34ebcaea/window_handle 200 5 ms - 119 

[HTTP] --> POST /wd/hub/session/26554ee3-1ce5-4e52-9773-54db34ebcaea/element {"using":"xpath","value":"/html/body/div/div/a"}

[MJSONWP] Driver proxy active, passing request on via HTTP proxy

[debug] [JSONWP Proxy] Proxying [POST /wd/hub/session/26554ee3-1ce5-4e52-9773-54db34ebcaea/element] to [POST http://127.0.0.1:8002/wd/hub/session/bb37a650bdf7b09a3af75a32e9d6247d/element]
with body: {"using":"xpath","value":"/html/body/div/div/a"}

[debug] [JSONWP Proxy] Got response with status 200: {"sessionId":"bb37a650bdf7b09a3af75a32e9d6247d","status":0,"value":{"ELEMENT":"0.8047745299561335-1"}}

[JSONWP Proxy] Replacing sessionId bb37a650bdf7b09a3af75a32e9d6247d with 26554ee3-1ce5-4e52-9773-54db34ebcaea

[HTTP] <-- POST /wd/hub/session/26554ee3-1ce5-4e52-9773-54db34ebcaea/element 200 97 ms - 106 

[HTTP] --> GET /wd/hub/session/26554ee3-1ce5-4e52-9773-54db34ebcaea/element/0.8047745299561335-1/text {}

[MJSONWP] Driver proxy active, passing request on via HTTP proxy

[debug] [JSONWP Proxy] Proxying [GET /wd/hub/session/26554ee3-1ce5-4e52-9773-54db34ebcaea/element/0.8047745299561335-1/text] to [GET http://127.0.0.1:8002/wd/hub/session/bb37a650bdf7b09a3af75a32e9d6247d/element/0.8047745299561335-1/text]
with body: {}

[debug] [JSONWP Proxy] Got response with status 200: "{\"sessionId\":\"bb37a650bdf7b09a3af75a32e9d6247d\",\"status\":0,\"value\":\"前往会员主页\"}"

[JSONWP Proxy] Replacing sessionId bb37a650bdf7b09a3af75a32e9d6247d with 26554ee3-1ce5-4e52-9773-54db34ebcaea

[HTTP] <-- GET /wd/hub/session/26554ee3-1ce5-4e52-9773-54db34ebcaea/element/0.8047745299561335-1/text 200 110 ms - 92 

[HTTP] --> POST /wd/hub/session/26554ee3-1ce5-4e52-9773-54db34ebcaea/element/0.8047745299561335-1/click {"id":"0.8047745299561335-1"}

[MJSONWP] Driver proxy active, passing request on via HTTP proxy

[debug] [JSONWP Proxy] Proxying [POST /wd/hub/session/26554ee3-1ce5-4e52-9773-54db34ebcaea/element/0.8047745299561335-1/click] to [POST http://127.0.0.1:8002/wd/hub/session/bb37a650bdf7b09a3af75a32e9d6247d/element/0.8047745299561335-1/click]
with body: {"id":"0.8047745299561335-1"}

[debug] [JSONWP Proxy] Got response with status 200: {"sessionId":"bb37a650bdf7b09a3af75a32e9d6247d","status":0,"value":null}

[JSONWP Proxy] Replacing sessionId bb37a650bdf7b09a3af75a32e9d6247d with 26554ee3-1ce5-4e52-9773-54db34ebcaea

[HTTP] <-- POST /wd/hub/session/26554ee3-1ce5-4e52-9773-54db34ebcaea/element/0.8047745299561335-1/click 200 266 ms - 76 

[HTTP] --> GET /wd/hub/session/26554ee3-1ce5-4e52-9773-54db34ebcaea/url {}

[MJSONWP] Driver proxy active, passing request on via HTTP proxy

[debug] [JSONWP Proxy] Proxying [GET /wd/hub/session/26554ee3-1ce5-4e52-9773-54db34ebcaea/url] to [GET http://127.0.0.1:8002/wd/hub/session/bb37a650bdf7b09a3af75a32e9d6247d/url]
with body: {}





happymff · #11 · 2017年02月09日

[MJSONWP] Encountered internal error running command: Error: Could not proxy. Proxy error: Could not proxy command to remote server. Original error: Error: ESOCKETTIMEDOUT

at doJwpProxy$ (../../../lib/mjsonwp/mjsonwp.js:343:13)

at tryCatch (/usr/local/lib/node_modules/appium/node_modules/.5.8.24@babel-runtime/regenerator/runtime.js:67:40)

at GeneratorFunctionPrototype.invoke as
_invoke

at GeneratorFunctionPrototype.prototype.(anonymous function) as
throw

at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/.5.8.24@babel-runtime/regenerator/runtime.js:136:37)

[HTTP] <-- GET /wd/hub/session/26554ee3-1ce5-4e52-9773-54db34ebcaea/url 500 240009 ms - 281 

[HTTP] --> DELETE /wd/hub/session/26554ee3-1ce5-4e52-9773-54db34ebcaea {}

[debug] [MJSONWP] Calling AppiumDriver.deleteSession() with args: ["26554ee3-1ce5-4e52-9773-54db34ebcaea"]

[debug] [AndroidDriver] Shutting down Android driver

[debug] [AndroidDriver] Stopping chromedriver for context WEBVIEW_com.tencent.mm:tools

[debug] [Chromedriver] Changed state to 'stopping'

[debug] [JSONWP Proxy] Proxying [DELETE /] to [DELETE http://127.0.0.1:8002/wd/hub/session/bb37a650bdf7b09a3af75a32e9d6247d]
with no body

[Chromedriver] [STDERR] [304.967][SEVERE]: Timed out receiving message from renderer: 300.000

[Chromedriver] [STDERR] [421.311][SEVERE]: Unable to receive message from renderer

[Logcat] Logcat terminated with code 0, signal null

[UiAutomator] UiAutomator exited unexpectedly with code 0, signal null

[debug] [UiAutomator] Moving to state 'stopped'

[debug] [AndroidDriver] Shutting down Android driver

[Appium] Closing session, cause was 'UiAUtomator shut down unexpectedly'

[Appium] Removing session 26554ee3-1ce5-4e52-9773-54db34ebcaea from our master session list

[debug] [AndroidDriver] Stopping chromedriver for context WEBVIEW_com.tencent.mm:tools

[debug] [Chromedriver] Changed state to 'stopping'

[debug] [JSONWP Proxy] Proxying [DELETE /] to [DELETE http://127.0.0.1:8002/wd/hub/session/bb37a650bdf7b09a3af75a32e9d6247d]
with no body

[debug] [JSONWP Proxy] Got response with status 200: "{\"sessionId\":\"bb37a650bdf7b09a3af75a32e9d6247d\",\"status\":0,\"value\":null}"

[Chromedriver] ProxyRequestError: Could not proxy command to remote server. Original error: Error: connect ECONNREFUSED 127.0.0.1:8002

at JWProxy.proxy$ (../../../lib/jsonwp-proxy/proxy.js:127:13)

at tryCatch (/usr/local/lib/node_modules/appium/node_modules/.5.8.24@babel-runtime/regenerator/runtime.js:67:40)

at GeneratorFunctionPrototype.invoke as
_invoke

at GeneratorFunctionPrototype.prototype.(anonymous function) as
throw

at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/.5.8.24@babel-runtime/regenerator/runtime.js:136:37)

{ ProxyRequestError: Could not proxy command to remote server. Original error: Error: connect ECONNREFUSED 127.0.0.1:8002

at JWProxy.proxy$ (../../../lib/jsonwp-proxy/proxy.js:127:13)

at tryCatch (/usr/local/lib/node_modules/appium/node_modules/.5.8.24@babel-runtime/regenerator/runtime.js:67:40)

at GeneratorFunctionPrototype.invoke as
_invoke

at GeneratorFunctionPrototype.prototype.(anonymous function) as
throw

at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/.5.8.24@babel-runtime/regenerator/runtime.js:136:37)

jsonwp: 

{ Error: connect ECONNREFUSED 127.0.0.1:8002

at Object.exports._errnoException (util.js:1022:11)

at exports._exceptionWithHostPort (util.js:1045:20)

at TCPConnectWrap.afterConnect as oncomplete

code: 'ECONNREFUSED',

errno: 'ECONNREFUSED',

syscall: 'connect',

address: '127.0.0.1',

port: 8002 } }

[debug] [ADB] Getting connected devices...

[debug] [Chromedriver] Changed state to 'stopped'

[debug] [ADB] Getting connected devices...

[debug] [ADB] 0 device(s) connected

Unhandled rejection Error: No device connected, cannot run adb shell command 'am force-stop com.tencent.mm'

at ADB.callee$0$0$ (../../../lib/tools/system-calls.js:208:11)

at tryCatch (/usr/local/lib/node_modules/appium/node_modules/.5.8.24@babel-runtime/regenerator/runtime.js:67:40)

at GeneratorFunctionPrototype.invoke as
_invoke

at GeneratorFunctionPrototype.prototype.(anonymous function) as
next

at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/.5.8.24@babel-runtime/regenerator/runtime.js:136:37)

[debug] [ADB] 0 device(s) connected

[Appium] Had trouble ending session 26554ee3-1ce5-4e52-9773-54db34ebcaea: No device connected, cannot run adb shell command 'am force-stop com.tencent.mm'

[Appium] Removing session 26554ee3-1ce5-4e52-9773-54db34ebcaea from our master session list

[MJSONWP] Encountered internal error running command: Error: No device connected, cannot run adb shell command 'am force-stop com.tencent.mm'

at ADB.callee$0$0$ (../../../lib/tools/system-calls.js:208:11)

at tryCatch (/usr/local/lib/node_modules/appium/node_modules/.5.8.24@babel-runtime/regenerator/runtime.js:67:40)

at GeneratorFunctionPrototype.invoke as
_invoke

at GeneratorFunctionPrototype.prototype.(anonymous function) as
next

at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/.5.8.24@babel-runtime/regenerator/runtime.js:136:37)

at process._tickCallback (internal/process/next_tick.js:103:7)

[HTTP] <-- DELETE /wd/hub/session/26554ee3-1ce5-4e52-9773-54db34ebcaea 500 176308 ms - 251





darkmanno6 · #12 · 2017年02月21日

找到一个暂时解决问题的办法,在再次进入一个h5页面的时候,先切回native,然后再切一次到webview就可以进行后续操作了,大家可以试试





oscar · #13 · 2017年03月01日

对 

darkmanno6 #12 
回复

遇到了同样的问题,求分享解决方案





budian · #14 · 2017年03月07日

对 

darkmanno6 #12 
回复

切回native,再一次切到webview的时候失败了,报错session找不到





rita07 · #15 · 2
月前

appium的配置里设置recreateChromeDriverSessions为true试试





yuxiu · #16 · 2
月前

对 

rita07 #15 
回复

文档上没有这个属性啊





yuxiu · #17 · 2
月前

对 

rita07 #15 
回复

尝试了下,这个属性确实有用, 感谢!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: