我见过很多问题,但无法实施任何答案。
System.setProperty "webdriver.chrome.driver","chromedriverchromedriver.exe");
driver = new ChromeDriver();
// Then what exactly do I do?
//I want to open my regular Chrome window with all plugins and cookies
从http://code.google.com/p/selenium/wiki/ChromeDriver#Starting_Chromium_with_Specific_Flags:
或者使用特定配置文件加载(请注意,可以在此处找到默认配置文件目录):
DesiredCapabilities capabilities = DesiredCapabilities.chrome(); capabilities.setCapability("chrome.switches", Arrays.asList("--user-data-dir=/path/to/profile/directory")); WebDriver driver = new ChromeDriver(capabilities);