谁能建议如何从 FirefoxDriver(功能)和 ChromeDriver(功能)中删除警告?
FIREFOX { @Override public DesiredCapabilities getDesiredCapabilities () { DesiredCapabilities 能力 = DesiredCapabilities.firefox (); 返回能力;}
@Override
public WebDriver getWebDriverObject (DesiredCapabilities capabilities)
{
return new FirefoxDriver (capabilities);
}
},
CHROME_Original
{
@Override
public DesiredCapabilities getDesiredCapabilities ()
{
DesiredCapabilities capabilities = DesiredCapabilities.chrome ();
capabilities.setCapability ("chrome.switches", Arrays.asList ("--no-default-browser-check"));
HashMap<String, String> chromePreferences = new HashMap<String, String> ();
chromePreferences.put ("profile.password_manager_enabled", "false");
capabilities.setCapability ("chrome.prefs", chromePreferences);
return capabilities;
}
@Override
public WebDriver getWebDriverObject (DesiredCapabilities capabilities)
{
return new ChromeDriver (capabilities);
}
},