简体   繁体   中英

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. Watir still keeps using 103 though.

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?

Yes, Chrome does not properly deal with browserVersion: https://bugs.chromium.org/p/chromedriver/issues/detail?id=3849

You need to pass in: binary: '/path/to/beta'

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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