大家好,之前由于 Android 端 App 把系统内核用 X5 浏览器内核替换,导致我无法切换 context 同时 Appium 无法查看 web 页元素,根据论坛上大神的方法配置了后,还是不行,大家有遇到过这种问题吗,怎么解决的?
Appium version
:v1.6.4Appium inspector
:1.1.0-beta.1System version
:4.4.4
def setUp(self):
desired_caps = {}
desired_caps['platformName'] = constants.Android_Platform_Name
desired_caps['platformVersion'] = constants.Andriod_Platfrom_Version
desired_caps['deviceName'] = constants.Andriod_Device_Name
desired_caps['unicodeKeyboard'] = "True"
desired_caps["resetKeyboard"] = "True"
desired_caps["noReset"] = "True"
desired_caps["chromeOptions"] = {'androidProcess':'com.tencent.smtt:tools'}
desired_caps['app'] = PATH(
constants.Apk_Dir
)
self.driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)
{"androidPackage":"com.jd.jrapp","androidUseRunningApp":true,"androidProcess":"com.tencent.smtt:tools","androidDeviceSerial":"5DYTG6DIVWEQT849"}}}
[JSONWP Proxy] Got response with status 200: {"sessionId":"2ef2252a817df311cb69a6b131a20a6b","status":100,"value":{"message":"chrome not reachable\n (Driver info: chromedriver=2.28.455517 (2c6d2707d8ea850c862f04ac066724273981e88f),platform=Mac OS X 10.12.4 x86_64)"}}
[Chromedriver] Chromedriver exited unexpectedly with code null, signal SIGTERM
[Chromedriver] Changed state to 'stopped'
[Chromedriver] Error: chrome not reachable
(Driver info: chromedriver=2.28.455517 (2c6d2707d8ea850c862f04ac066724273981e88f),platform=Mac OS X 10.12.4 x86_64)
at Chromedriver.callee$2$0$ (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-chromedriver/lib/chromedriver.js:176:15)
at tryCatch (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at GeneratorFunctionPrototype.invoke (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
Error: chrome not reachable
(Driver info: chromedriver=2.28.455517 (2c6d2707d8ea850c862f04ac066724273981e88f),platform=Mac OS X 10.12.4 x86_64)
at Chromedriver.callee$2$0$ (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-chromedriver/lib/chromedriver.js:176:15)
at tryCatch (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at GeneratorFunctionPrototype.invoke (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
[MJSONWP] Encountered internal error running command: Error: chrome not reachable
(Driver info: chromedriver=2.28.455517 (2c6d2707d8ea850c862f04ac066724273981e88f),platform=Mac OS X 10.12.4 x86_64)
at Chromedriver.callee$2$0$ (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-chromedriver/lib/chromedriver.js:176:15)
at tryCatch (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at GeneratorFunctionPrototype.invoke (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
[HTTP] <-- POST /wd/hub/session/d263497b-56fd-4605-81b1-897dbfd4c616/context 500 244334 ms - 310
[HTTP] --> DELETE /wd/hub/session/d263497b-56fd-4605-81b1-897dbfd4c616 {}
[MJSONWP] Calling AppiumDriver.deleteSession() with args: ["d263497b-56fd-4605-81b1-897dbfd4c616"]
[BaseDriver] Event 'quitSessionRequested' logged at 1497346805693 (17:40:05 GMT+0800 (CST))
[AndroidDriver] Shutting down Android driver
[AndroidDriver] Resetting IME to io.appium.android.ime/.UnicodeIME