I'm using C# / Selenium 3 to launch and control instances of Edge (Chromium). One of the requirements I have is that any instance of Edge launched by my code should use the default profile (The one that Edge uses if you open it normally). I can do this with one instance of Edge by using the user-data-dir argument. But if I try to launch another instance then I get an several errors in the new web driver window (Access is denied, Unable to create Cache, Error reading broker pipe: The pipe has been ended). I'm guessing the user-data-dir is in use by the first instance. Do I need to create a copy of the profile some how?
EdgeDriverService edgeDriverService = EdgeDriverService.CreateChromiumService(webDriverPath);
edgeDriverService.HideCommandPromptWindow = !debug;
EdgeOptions edgeOptions = new ()
{
UseChromium = true
};
edgeOptions.AddArgument("profile-directory=Default");
edgeOptions.AddArgument(@"user-data-dir=C:\Users\xxxxxx\AppData\Local\Microsoft\Edge\User Data");
this._webDriver = new EdgeDriver(edgeDriverService, edgeOptions);