简体   繁体   English

在 Watir 中设置浏览器设置

[英]Setting browser settings in Watir

Because of some bugs when using Watir in Chrome 103, I've downloaded Chrome Beta 104 and set it as the default browser.由于在 Chrome 103 中使用 Watir 时出现一些错误,我下载了 Chrome Beta 104 并将其设置为默认浏览器。 Watir still keeps using 103 though. Watir 仍然继续使用 103。

I've also tried setting the browser version in the parameters but didn't help.我也尝试在参数中设置浏览器版本,但没有帮助。

prefs = {
  intl: {accept_languages: 'en-GB'},
  browserVersion: '104.0.5112.48' # also tried 'browser_version' and didn't work either
}
b = Watir::Browser.new :chrome, options: {prefs: prefs}

How do I make it use Chrome 104?如何让它使用 Chrome 104?

Yes, Chrome does not properly deal with browserVersion: https://bugs.chromium.org/p/chromedriver/issues/detail?id=3849是的,Chrome 不能正确处理 browserVersion: https ://bugs.chromium.org/p/chromedriver/issues/detail?id=3849

You need to pass in: binary: '/path/to/beta'你需要传入: binary: '/path/to/beta'

https://chromedriver.chromium.org/capabilities#h.p_ID_106 https://chromedriver.chromium.org/capabilities#h.p_ID_106

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM