无法在 Chrome 中切换到新窗口。我收到以下错误:
未知错误:DevTools 返回未知类型:webview
我在 Chrome 自动更新后发生了这种情况(我知道,我们真的应该禁用它)。如果您查看ChromeDriver 的发行说明,您可以验证您的 Chrome 和 ChromeDriver 版本是否兼容。
通过将 ChromeDriver 更新到最新版本,此错误已得到解决。
这是由于旧的 ChromeDriver,请在此处检查 ChromeDriver 并将其更新为最新版本。
My answer is exactly the same as the others: your chromedriver needs updating.
However: If you are using ruby (selenium, watir, etc) then you are accessing chromedriver through a helper gem called chromedriver2-helper. This gem, as well as providing chromedriver in your path, also comes with a handy chromedriver updater - also in your path - called chromedriver-update. So from the command line, I would suggest you do the following:
# Make sure your chromedriver helper is up-to-date:
gem update chromedriver
# Now update chromedriver itself.
chromedriver-update
Once that's done, hopefully your selenium should just work.