我见过很多问题,但无法实现任何答案。
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
答案 0 :(得分:1)
来自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);