print self.driver.contexts:
[u'NATIVE_APP', u'WEBVIEW_undefined', u'WEBVIEW_com.android.browser', u'WEBVIEW_com.android.quicksearchbox']

备注:我不知道为什么有时候会 print 出 u'WEBVIEW_undefined

aaa='WEBVIEW_com.tencent.mm:tools'
self.driver.switch_to.context(aaa)
sleep(5)
self.driver.find_element_by_class_name('search_item_inner').click()

具体操作就是这样的,有时候切 webview 就直接报错,有时候切进 webview 的时候 一直处于缓冲状态! 报错 chrome not reachable

appium 代码报错如下

error: Chromedriver: Chromedriver exited unexpectedly with code null, signal SIGTERM
info: Chromedriver: Changed state to 'stopped'
error: Chromedriver: Error: An error occurred (Original error: chrome not reachable
(Driver info: chromedriver=2.18.343837
warn: Chromedriver for context WEBVIEW_com.tencent.mm:tools stopped unexpectedly
warn: Chromedriver quit unexpectedly, but it wasn't the active context, ignoring

环境是:

求大神请教阿


↙↙↙阅读原文可查看相关链接,并与作者交流