【发布时间】:2017-03-14 17:57:17
【问题描述】:
我正在使用 Selenium webdriver 3.3 和 ChromeDriver 2.28(32 位)。我的从机是运行 Chrome 57 的 Windows 7。
当 Chrome 启动时,我尝试通过 RemoteWebDriver 使用 ChromeOptions 来禁用使用参数“password_manager_enabled”的“保存密码”弹出窗口。
但是,它似乎完全没有效果。我已经尝试了很多关于 ChromeOptions、JSON 字符串和简单字符串的变体,但都无济于事。
ChromeOptions cOpt = new ChromeOptions();
cOpt.addUserProfilePreference("profile.password_manager_enabled", false);
var capabilities = chromeOpts.ToCapabilities() as DesiredCapabilities;
// Add OS, Platform capabilities etc
string gridConnectionURL = "xxxx"
driver = new CustomRemoteDriver(new Uri(gridConnectionURL), capabilities, new TimeSpan(0, 5, 0));
有没有人知道设置此首选项的“正确”方法以使其起作用?
【问题讨论】:
-
我刚刚意识到 ChromeDriver 似乎在 C:\Users\
\AppData\Local\Temp 位置创建了一个临时配置文件。当我查看此配置文件时,会出现设置。但 Chrome 似乎忽略了它。
标签: c# google-chrome selenium selenium-webdriver selenium-chromedriver