There are Known Issues on the official Chrome Driver wiki page, which I had not noticed before:
Known Issues
3. Unable to specify custom profile
Now I do not know whether or not it is out of date. I could not find the error report. It is true that you cannot specify a custom profile through Capabilities (as of July 2013), as you discovered. But there is a solution ...
Decision
Here's how I managed to run it:
ChromeOptions opt = new ChromeOptions(); opt.setBinary("E:\\some\\path\\chrome.exe"); opt.addArguments("--user-data-dir=C:\\Users\\Owner\\AppData\\Local\\Google\\Chrome\\User Data"); driver = new ChromeDriver(opt);
Pay attention to the path to the user data directory - it does not have the \\Default part. And in this case, it is great for me, it opens a Chrome profile stored with all cookies and logins.
I have no idea why the Capabilities solution is not working. Perhaps it would be to write down the error , because I could not find it on the topic.
source share