Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
试过了
handle = self.driver.window_handles[0] self.driver.switch_to_window(handle)
在模拟器上,但没有运气。我无法访问/操作页面中的元素。我什至不知道我是否切换到网络视图。
关于如何通过 appium (python) 在 iOS 上使用 Web 视图有什么建议吗?
driver.window_handles[0]可能是当前窗口 - 尝试检查window_handles以查看其他可用的窗口。在 iOS 上,我测试的应用程序只有窗口句柄,如“1”、“2”等,切换到 window_handles 的最后一个元素通常可以解决问题。
driver.window_handles[0]
window_handles
如果您使用的是 appium 1.0,请使用以下代码切换到 WebView
self.driver.switch_to.context('WEBVIEW');