其他测试框架 做安卓 UI 自动化的时候,切换到 h5 页面一直不成功,求救

小蜜蜂 · 2019年09月29日 · 最后由 小蜜蜂 回复于 2019年10月14日 · 2202 次阅读

Chromedriver version: '72.0.3626.69'
[WD Proxy] Matched '/status' to command name 'getStatus'
[WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8000/wd/hub/status] with no body
[WD Proxy] Got response with status 200: "{\"sessionId\":\"\",\"status\":0,\"value\":{\"build\":{\"version\":\"alpha\"},\"os\":{\"arch\":\"x86_64\",\"name\":\"Windows NT\",\"version\":\"10.0.17763\"}}}"
[WD Proxy] Determined that the downstream protocol for proxy is MJSONWP
[WD Proxy] Matched '/session' to command name 'createSession'
[WD Proxy] Proxying [POST /session] to [POST http://127.0.0.1:8000/wd/hub/session] with body: {"desiredCapabilities":{"chromeOptions":{"androidPackage":xxxx","androidUseRunningApp":true,"androidDeviceSerial":"e826c01e"},"loggingPrefs":{"browser":"ALL"}}}
[Chromedriver] Webview version: 'Chrome/72.0.3626.121'
[WD Proxy] Got response with status 200: {"sessionId":"765654543","status":13,"value":{"message":"unknown error: unable to discover open pages\n (Driver info: chromedriver=72.0.3626.69 (3c16f8a135abc0d4da2dff33804db79b849a7c38),platform=Windows NT 10.0.17763 x86_64)"}}
[WD Proxy] Got an unexpected response: {"sessionId":"85bc8f25b89a95fe02fa88ab4ca23c4a","status":13,"value":{"message":"unknown error: unable to discover open pages\n (Driver info: chromedriver=72.0.3626.69 (3c16f8a135abc0d4da2dff33804db79b849a7c38),platform=Windows NT 10.0.17763 x86_64)"}}
[MJSONWP] Matched JSONWP error code 13 to UnknownError
[Chromedriver] Error: Failed to start Chromedriver session: An unknown server-side error occurred while processing the command. Original error: unknown error: unable to discover open pages
Chromedriver
[Chromedriver] at Object.wrappedLogger.errorAndThrow (C:\Program Files\Appium\resources\app\node_modules\appium\node_modules\appium-support\lib\logging.js:78:13)
[Chromedriver] at errorAndThrow (C:\Program Files\Appium\resources\app\node_modules\appium\node_modules\appium-chromedriver\lib\chromedriver.js:493:13)
[WD Proxy] Matched '/session' to command name 'createSession'
[WD Proxy] Proxying [POST /session] to [POST http://127.0.0.1:8000/wd/hub/session] with body: {"desiredCapabilities":{"chromeOptions":{"androidPackage":"xxxxx","androidUseRunningApp":true,"androidDeviceSerial":"e826c01e"},"loggingPrefs":{"browser":"ALL"}}}

如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!
共收到 2 条回复 时间 点赞

应该是 Chrome 版本没对上,可以先查下手机的 Chrome 版本:

adb shell dumpsys package com.google.android.webview | grep versionName

appium 启动对应驱动命令:

appium --chromedriver-executable /path/to/my/chromedriver
wuuuuu 回复

已经解决了,开始是 webview 调试模式没打开,加上版本估计也没对应上

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