问题
appium 微信公众号自动化时,无法切换 webview
1.发现系统版本 webview53,已经打了更新包,更新为 57,同时选择了 webview 的实现方式
2.测试机,电脑均已重启后尝试过
系统环境
1.py3+win10+appium(1.8.1)+oppor11
2.Android system webview 更新 webview 为 57
3.微信已经开启调试模式
appium 报错截图
代码中报错
appium-server 报错日志
发现依然无法切换 context
[ADB] Running 'D:\android-sdk-windows\platform-tools\adb.exe -P 5037 -s 4ba06e0e shell ps'
[AndroidDriver] Parsed pid: '10739' pkg: 'com.tencent.mm:toolsmp' from
[AndroidDriver] USER PID PPID VSIZE RSS FRZ WCHAN PC NAME
[AndroidDriver] u0_a275 10739 988 2485748 116000 unk 0 0000000000 S com.tencent.mm:toolsmp
[AndroidDriver] Returning process name: 'com.tencent.mm:toolsmp'
[AndroidDriver] Parsed pid: '10728' pkg: 'com.tencent.mm:tools' from
[AndroidDriver] USER PID PPID VSIZE RSS FRZ WCHAN PC NAME
[AndroidDriver] u0_a275 10728 988 2676548 158708 unk 0 0000000000 S com.tencent.mm:tools
[AndroidDriver] Returning process name: 'com.tencent.mm:tools'
[AndroidDriver] Found webviews: ["WEBVIEW_com.tencent.mm:toolsmp","WEBVIEW_com.tencent.mm:tools"]
[AndroidDriver] Available contexts: ["NATIVE_APP","WEBVIEW_com.tencent.mm:toolsmp","WEBVIEW_com.tencent.mm:tools"]
[AndroidDriver] Connecting to chrome-backed webview context 'WEBVIEW_com.tencent.mm:tools'
[AndroidDriver] A port was not given, using random port: 8000
[Chromedriver] Changed state to 'starting'
[Chromedriver] The following Chromedriver executables were found:
[Chromedriver] D:/codes/autotest_server4/codes35_api_jiekuan/guguji/my_drivers/chromedriver_2.29.exe (minimum Chrome version '57.0.2987')
[ADB] Getting package info for 'com.google.android.webview'
[ADB] Running 'D:\android-sdk-windows\platform-tools\adb.exe -P 5037 -s 4ba06e0e shell dumpsys package com.google.android.webview'
[Chromedriver] Found Chrome bundle 'com.google.android.webview' version '57.0.2987'
[Chromedriver] Found 1 Chromedriver executable capable of automating Chrome '57.0.2987'.
[Chromedriver] Choosing the most recent, 'D:/codes/autotest_server4/codes35_api_jiekuan/guguji/my_drivers/chromedriver_2.29.exe'.
[Chromedriver] If a specific version is required, specify it with the `chromedriverExecutable`desired capability.
[Chromedriver] Set chromedriver binary as: D:/codes/autotest_server4/codes35_api_jiekuan/guguji/my_drivers/chromedriver_2.29.exe
[Chromedriver] Killing any old chromedrivers, running: FOR /F "usebackq tokens=5" %a in (`netstat -nao ^| findstr /R /C:"8000 "`) do (FOR /F "usebackq" %b in (`TASKLIST /FI "PID eq %a" ^| findstr /I chromedriver.exe`) do (IF NOT %b=="" TASKKILL /F /PID %a))
[Chromedriver] No old chromedrivers seemed to exist
[Chromedriver] Cleaning any old adb forwarded port socket connections
[ADB] List forwarding ports
[ADB] Running 'D:\android-sdk-windows\platform-tools\adb.exe -P 5037 -s 4ba06e0e forward --list'
[Chromedriver] Spawning chromedriver with: D:/codes/autotest_server4/codes35_api_jiekuan/guguji/my_drivers/chromedriver_2.29.exe --url-base=wd/hub --port=8000 --adb-port=5037 --verbose
[Chromedriver] Chromedriver version: '2.29.461591'
[JSONWP Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8000/wd/hub/status] with no body
[JSONWP Proxy] Got response with status 200: "{\"sessionId\":\"\",\"status\":0,\"value\":{\"build\":{\"version\":\"alpha\"},\"os\":{\"arch\":\"x86_64\",\"name\":\"Windows NT\",\"version\":\"10.0.10240\"}}}"
[JSONWP Proxy] Proxying [POST /session] to [POST http://127.0.0.1:8000/wd/hub/session] with body: {"desiredCapabilities":{"chromeOptions":{"androidPackage":"com.tencent.mm","androidUseRunningApp":true,"androidProcess":"com.tencent.mm:tools","androidDeviceSerial":"4ba06e0e"}}}
[JSONWP Proxy] Got response with status 200: {"sessionId":"91480890a23673011ffdbad54545bfe0","status":100,"value":{"message":"chrome not reachable\n (Driver info: chromedriver=2.29.461591 (62ebf098771772160f391d75e589dc567915b233),platform=Windows NT 10.0.10240 x86_64)"}}
[Chromedriver] Error: Failed to start Chromedriver session: An error occurred (Original error: chrome not reachable
[Chromedriver] (Driver info: chromedriver=2.29.461591 (62ebf098771772160f391d75e589dc567915b233),platform=Windows NT 10.0.10240 x86_64))
[Chromedriver] at Object.wrappedLogger.errorAndThrow (C:\Program Files (x86)\Appium\resources\app\node_modules\appium\node_modules\appium-support\lib\logging.js:78:13)
[Chromedriver] at Chromedriver.callee$2$0$ (C:\Program Files (x86)\Appium\resources\app\node_modules\appium\node_modules\appium-chromedriver\lib\chromedriver.js:411:13)
[Chromedriver] at tryCatch (C:\Program Files (x86)\Appium\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:67:40)
[Chromedriver] at GeneratorFunctionPrototype.invoke [as _invoke] (C:\Program Files (x86)\Appium\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:315:22)
[Chromedriver] at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (C:\Program Files (x86)\Appium\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:100:21)
[Chromedriver] at GeneratorFunctionPrototype.invoke (C:\Program Files (x86)\Appium\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:136:37)
[Chromedriver] at
[JSONWP Proxy] Proxying [POST /session] to [POST http://127.0.0.1:8000/wd/hub/session] with body: {"desiredCapabilities":{"chromeOptions":{"androidPackage":"com.tencent.mm","androidUseRunningApp":true,"androidProcess":"com.tencent.mm:tools","androidDeviceSerial":"4ba06e0e"}}}
[JSONWP Proxy] Got response with status 200: {"sessionId":"646641c468f7338b97540e57b00d115a","status":100,"value":{"message":"chrome not reachable\n (Driver info: chromedriver=2.29.461591 (62ebf098771772160f391d75e589dc567915b233),platform=Windows NT 10.0.10240 x86_64)"}}
[Chromedriver] Error: Failed to start Chromedriver session: An error occurred (Original error: chrome not reachable
[Chromedriver] (Driver info: chromedriver=2.29.461591 (62ebf098771772160f391d75e589dc567915b233),platform=Windows NT 10.0.10240 x86_64))
[Chromedriver] at Object.wrappedLogger.errorAndThrow (C:\Program Files (x86)\Appium\resources\app\node_modules\appium\node_modules\appium-support\lib\logging.js:78:13)
[Chromedriver] at Chromedriver.callee$2$0$ (C:\Program Files (x86)\Appium\resources\app\node_modules\appium\node_modules\appium-chromedriver\lib\chromedriver.js:411:13)
[Chromedriver] at tryCatch (C:\Program Files (x86)\Appium\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:67:40)
[Chromedriver] at GeneratorFunctionPrototype.invoke [as _invoke] (C:\Program Files (x86)\Appium\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:315:22)
[Chromedriver] at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (C:\Program Files (x86)\Appium\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:100:21)
[Chromedriver] at GeneratorFunctionPrototype.invoke (C:\Program Files (x86)\Appium\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:136:37)
[Chromedriver] at
[JSONWP Proxy] Proxying [POST /session] to [POST http://127.0.0.1:8000/wd/hub/session] with body: {"desiredCapabilities":{"chromeOptions":{"androidPackage":"com.tencent.mm","androidUseRunningApp":true,"androidProcess":"com.tencent.mm:tools","androidDeviceSerial":"4ba06e0e"}}}
[JSONWP Proxy] Got response with status 200: {"sessionId":"7d28693bd641c89c52f12abf783dbfc2","status":100,"value":{"message":"chrome not reachable\n (Driver info: chromedriver=2.29.461591 (62ebf098771772160f391d75e589dc567915b233),platform=Windows NT 10.0.10240 x86_64)"}}
[Chromedriver] Error: Failed to start Chromedriver session: An error occurred (Original error: chrome not reachable
[Chromedriver] (Driver info: chromedriver=2.29.461591 (62ebf098771772160f391d75e589dc567915b233),platform=Windows NT 10.0.10240 x86_64))
[Chromedriver] at Object.wrappedLogger.errorAndThrow (C:\Program Files (x86)\Appium\resources\app\node_modules\appium\node_modules\appium-support\lib\logging.js:78:13)
[Chromedriver] at Chromedriver.callee$2$0$ (C:\Program Files (x86)\Appium\resources\app\node_modules\appium\node_modules\appium-chromedriver\lib\chromedriver.js:411:13)
[Chromedriver] at tryCatch (C:\Program Files (x86)\Appium\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:67:40)
[Chromedriver] at GeneratorFunctionPrototype.invoke [as _invoke] (C:\Program Files (x86)\Appium\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:315:22)
[Chromedriver] at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (C:\Program Files (x86)\Appium\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:100:21)
[Chromedriver] at GeneratorFunctionPrototype.invoke (C:\Program Files (x86)\Appium\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:136:37)
[Chromedriver] at
[JSONWP Proxy] Proxying [POST /session] to [POST http://127.0.0.1:8000/wd/hub/session] with body: {"desiredCapabilities":{"chromeOptions":{"androidPackage":"com.tencent.mm","androidUseRunningApp":true,"androidProcess":"com.tencent.mm:tools","androidDeviceSerial":"4ba06e0e"}}}
[JSONWP Proxy] Got response with status 200: {"sessionId":"25d5891e13c8c9ef8fb2ee53257afbc5","status":100,"value":{"message":"chrome not reachable\n (Driver info: chromedriver=2.29.461591 (62ebf098771772160f391d75e589dc567915b233),platform=Windows NT 10.0.10240 x86_64)"}}
[Chromedriver] Error: Failed to start Chromedriver session: An error occurred (Original error: chrome not reachable
[Chromedriver] (Driver info: chromedriver=2.29.461591 (62ebf098771772160f391d75e589dc567915b233),platform=Windows NT 10.0.10240 x86_64))
[Chromedriver] at Object.wrappedLogger.errorAndThrow (C:\Program Files (x86)\Appium\resources\app\node_modules\appium\node_modules\appium-support\lib\logging.js:78:13)
[Chromedriver] at Chromedriver.callee$2$0$ (C:\Program Files (x86)\Appium\resources\app\node_modules\appium\node_modules\appium-chromedriver\lib\chromedriver.js:411:13)
[Chromedriver] at tryCatch (C:\Program Files (x86)\Appium\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:67:40)
[Chromedriver] at GeneratorFunctionPrototype.invoke [as _invoke] (C:\Program Files (x86)\Appium\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:315:22)
[Chromedriver] at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (C:\Program Files (x86)\Appium\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:100:21)
[Chromedriver] at GeneratorFunctionPrototype.invoke (C:\Program Files (x86)\Appium\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:136:37)
[Chromedriver] at
[Chromedriver] Chromedriver exited unexpectedly with code null, signal SIGTERM
[Chromedriver] Changed state to 'stopped'
[Chromedriver] Error: Failed to start Chromedriver session: An error occurred (Original error: chrome not reachable
[Chromedriver] (Driver info: chromedriver=2.29.461591 (62ebf098771772160f391d75e589dc567915b233),platform=Windows NT 10.0.10240 x86_64))
[Chromedriver] at Object.wrappedLogger.errorAndThrow (C:\Program Files (x86)\Appium\resources\app\node_modules\appium\node_modules\appium-support\lib\logging.js:78:13)
[Chromedriver] at Chromedriver.callee$2$0$ (C:\Program Files (x86)\Appium\resources\app\node_modules\appium\node_modules\appium-chromedriver\lib\chromedriver.js:411:13)
[Chromedriver] at tryCatch (C:\Program Files (x86)\Appium\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:67:40)
[Chromedriver] at GeneratorFunctionPrototype.invoke [as _invoke] (C:\Program Files (x86)\Appium\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:315:22)
[Chromedriver] at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (C:\Program Files (x86)\Appium\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:100:21)
[Chromedriver] at GeneratorFunctionPrototype.invoke (C:\Program Files (x86)\Appium\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:136:37)
[Chromedriver] at
[MJSONWP] Encountered internal error running command: Error: Failed to start Chromedriver session: An error occurred (Original error: chrome not reachable
[MJSONWP] (Driver info: chromedriver=2.29.461591 (62ebf098771772160f391d75e589dc567915b233),platform=Windows NT 10.0.10240 x86_64))
[MJSONWP] at Object.wrappedLogger.errorAndThrow (C:\Program Files (x86)\Appium\resources\app\node_modules\appium\node_modules\appium-support\lib\logging.js:78:13)
[MJSONWP] at Chromedriver.callee$2$0$ (C:\Program Files (x86)\Appium\resources\app\node_modules\appium\node_modules\appium-chromedriver\lib\chromedriver.js:411:13)
[MJSONWP] at tryCatch (C:\Program Files (x86)\Appium\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:67:40)
[MJSONWP] at GeneratorFunctionPrototype.invoke [as _invoke] (C:\Program Files (x86)\Appium\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:315:22)
[MJSONWP] at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (C:\Program Files (x86)\Appium\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:100:21)
[MJSONWP] at GeneratorFunctionPrototype.invoke (C:\Program Files (x86)\Appium\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:136:37)
[MJSONWP] at
[HTTP] <-- POST /wd/hub/session/2f8a67fd-9af2-4e7a-93e2-7de97511d622/context 500 249907 ms - 389
[HTTP]
[UiAutomator2] [UIAutomator2] io.appium.uiautomator2.server.test.AppiumUiAutomator2Server:INSTRUMENTATION_RESULT: shortMsg=Process crashed.
[UiAutomator2] [UIAutomator2] INSTRUMENTATION_CODE: 0
求求各位大佬帮忙瞧瞧,2 天了啥手段都尝试了,切换还是报错