Appium [已解决] appium 在安卓手机执行小程序自动化,在切换 context 会卡住,过几分钟后就报错,说设备不在线,或者远程关闭连接

笑哼 for 转转QA · March 20, 2018 · Last by fhvch replied at July 18, 2018 · 3859 hits


能正确打印出contexts

共收到 7 条回复 时间 点赞

我也遇到这个问题了 有的博客正常切,我现在切不了 一切就会一直卡主 等几分钟才报错:谷歌驱动换了很多个 感觉不是驱动的问题
Error: Failed to start Chromedriver session: An error occurred (Original error: chrome not reachable
(Driver info: chromedriver=2.37.543627 (63642262d9fb93fb4ab52398be4286d844092a5e),platform=Windows NT 10.0.16299 x86_64))

笑哼 #2 · March 22, 2018 作者
宣梦达 回复

我的情形和你的类似,可以私聊,我微信号Xh0102GEM

@18070592371 @xiaohengdada 我遇到的也是这个问题,华为 V10 就不行,换到了 VIVO X5就可以了,现在也在纠结这个问题,在想是不 是 chromedriver 的坑,或者安卓系统不同的坑,你那解决了吗?

回复

没解决 我也在怀疑是官方BUG。我新手机就不能切换

笑哼 #5 · June 25, 2018 作者
回复

这个就我这边来看,我觉得和android system webview以及安卓系统有关。小米的测试机基本都能拿到

笑哼 回复

怎么解决的? 我就是小米的手机 不过刷的是别的rom

Traceback (most recent call last):
File "E:\pyworkspace\demos\webview_test\webview_tests.py", line 70, in <module>
switch_context(driver)
File "E:\pyworkspace\demos\webview_test\webview_tests.py", line 23, in switch_context
driver.switch_to.context(context)
File "D:\Program Files\Python\Python36\lib\site-packages\appium\webdriver\switch_to.py", line 31, in context
self._driver.execute(MobileCommand.SWITCH_TO_CONTEXT, {'name': context_name})
File "D:\Program Files\Python\Python36\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 314, in execute
self.error_handler.check_response(response)
File "D:\Program Files\Python\Python36\lib\site-packages\appium\webdriver\errorhandler.py", line 29, in check_response
raise wde
File "D:\Program Files\Python\Python36\lib\site-packages\appium\webdriver\errorhandler.py", line 24, in check_response
super(MobileErrorHandler, self).check_response(response)
File "D:\Program Files\Python\Python36\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command. Original error: Failed to start Chromedriver session: An error occurred (Original error: chrome not reachable
(Driver info: chromedriver=2.30.477700 (0057494ad8732195794a7b32078424f92a5fce41),platform=Windows NT 6.1.7601 SP1 x86_64))

需要 Sign In 后方可回复, 如果你还没有账号请点击这里 Sign Up