【发布时间】:2018-01-31 11:10:25
【问题描述】:
我正在使用以下代码,但无法处理密码通知(在 Google Chrome 中):
ChromeOptions options = new ChromeOptions();
//options.setExperimentalOption("credentials_enable_service", false);
options.setExperimentalOption("profile.password_manager_enabled", false);
System.setProperty("webdriver.chrome.driver","C:\\Users\\Prashant\\Downloads\\chromedriver.exe");
driver = new ChromeDriver(options);
错误信息-
线程“主”org.openqa.selenium.WebDriverException 中的异常: 未知错误:无法解析功能:来自未知的 chromeOptions 错误:无法识别的 chrome 选项:profile.password_manager_enabled。
【问题讨论】:
-
线程“主”org.openqa.selenium.WebDriverException 中的异常:未知错误:无法解析功能:来自未知错误的 chromeOptions:无法识别的 chrome 选项:profile.password_manager_enabled。以上是错误信息
-
我可以知道您为什么需要设置选项吗?如果你禁用它,那么它应该可以工作。
-
我按照你的方法试过了。但它没有用。我搜索了禁用通知的方法,发现上面提到的代码在实例化 ChromeDriver 时需要传递 ChromeOption 对象,但我的目标仍然没有实现
标签: java google-chrome selenium