I have difficult time trying to load multiple chrome profile at the same time, and it always show "unknown error: failed to write prefs file" .I'm using selenium 2.48.2 and Selenium.WebDriver.ChromeDriver 2.20.0.0
string localAppDataPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
String chromeLocalAppDataPath = localAppDataPath + @"\Google\Chrome\User Data\Default\";
var options = new ChromeOptions();
options.AddArgument("--no-experiments");
options.AddArguments("user-data-dir=" + chromeLocalAppDataPath);
options.AddArgument("--disable-translate");
options.AddArguments("--start-maximized");
//options.AddArgument("--disable-plugins");
//options.AddArgument("--disable-extensions");
options.AddArgument("--no-default-browser-check");
options.AddArgument("--clear-token-service");
options.AddArgument("--disable-default-apps");
options.AddArgument("--no-displaying-insecure-content");
//options.AddArgument("--disable-block-external-urls");
options.AddArgument("--disable-bundled-ppapi-flash");
using (abcDataContext db = new abcDataContext())
{
Parallel.ForEach(fixtures, (current) =>
{
using (IWebDriver driver = new ChromeDriver(options)) // fail right here
{
driver.Navigate().GoToUrl("http://google.com");
}
});
counter++;
}
while (counter <= fixtures.Count() / 3);
}
UPDATE: using firefoxdriver, it works fine with default profile
FirefoxProfileManager profileManager = new FirefoxProfileManager();
FirefoxProfile profile = profileManager.GetProfile("default");
Parallel.ForEach(collections, (current) =>
{
IWebDriver driver = new FirefoxDriver(profile);
driver.Navigate().GoToUrl("http://google.com");
});