...
driver.find_element_by_xpath("//*[@text='xxx']").click()
self.dc['noReset'] = True
self.dc['appPackage'] = "com.tencent.mm"
self.dc['appActivity'] = ".ui.LauncherUI"
self.dc['platformName'] = 'Android'
self.dc['deviceName'] = 'M2010J19SC'
self.dc['chromeOptions'] = {'androidProcess': 'com.tencent.mm:tools'}
self.driver = webdriver.Remote("http://localhost:4723/wd/hub", self.dc)
...
print("1 ", driver.contexts)
print("1 ", driver.current_context)
time.sleep(5)
print("2 ", driver.contexts)
print("2 ", driver.current_context)
driver.switch_to.context('WEBVIEW_com.tencent.mm:tools')
print("3 ", driver.contexts)
print("3 ", driver.current_context)
...
打印日志为:
1 ['NATIVE_APP']
1 NATIVE_APP
2 ['NATIVE_APP', 'WEBVIEW_com.tencent.mm:tools']
2 NATIVE_APP
selenium.common.exceptions.WebDriverException:消息:处理命令时发生未知的服务器端错误。原始错误:io.appium.uiautomator2.common.exceptions.UiAutomator2Exception:在活动窗口中等待根 AccessibilityNodeInfo 15525 毫秒后超时。确保活动窗口不会持续占用主 UI 线程(例如,应用程序空闲足够长的时间),以便辅助功能管理器可以完成其工作。
为什么无法切换到“WEBVIEW_com.tencent.mm:tools”?有人可以帮忙吗?
我遇到了类似的问题,appium可以使用旧版微信7.0.12,但现在腾讯屏蔽了旧版微信登录。
我也遇到了同样的问题,请问现在可以解决吗?