【发布时间】:2016-11-16 09:47:58
【问题描述】:
是否可以使用现有的 chrome 用户/配置文件配置 watir webdriver
(由 chrome.exe 创建 --user-data-dir=C:\MyChromeUserProfile)
在 Firefox 中可以执行以下操作:
(使用 firefox -P 创建了一个用户配置文件)profile = Selenium::WebDriver::Firefox::Profile.new(c://MyFFUserProfile)
Watir::Browser.new :ff, :profile => profile
对于Chrome,我尝试了以下代码无济于事:Watir::Browser.new :chrome, :switches => %w['--user-data-dir=c://MyChromeUserProfile']
虽然这会打开一个 chrome 会话,但它不使用用户的配置文件设置(特别是已安装和配置的扩展,例如用于 HTTP 基本身份验证的 Multi-pass)。
顺便说一下,这是一个类似的解决方法,但对于我正在尝试实现的 chrome,就像在 http://watirwebdriver.com/basic-browser-authentication/ 上发布的 Firefox 和自动身份验证一样)
【问题讨论】:
标签: google-chrome webdriver watir multipass