I am trying to run chrome webdriver with a profile, so i can store cookies and username / passwords. However, when i try to combine this with headless mode, it errors:
DevTools listening on ws://127.0.0.1:63585/devtools/browser/ab7a020f-e412-4204-a53a-285e0b3a15c4
[0824/105430.911:ERROR:devtools_http_handler.cc(288)] Error writing DevTools active port to file
[0824/105430.916:ERROR:cache_util_win.cc(19)] Unable to move the cache: 3
[0824/105430.916:ERROR:cache_util.cc(135)] Unable to move cache folder cookies/PresFox1\Default\GPUCache to cookies/PresFox1\Default\old_GPUCache_000
[0824/105430.917:ERROR:disk_cache.cc(169)] Unable to create cache
[0824/105430.917:ERROR:shader_disk_cache.cc(600)] Shader Cache Creation failed: -2
Code:
public static void login(string username, string password)
{
ChromeOptions options = new ChromeOptions();
//options.AddArgument("--start-maximized");
options.AddArgument("--user-data-dir=cookies/"+username);
options.AddArgument("--headless");
IWebDriver driver = new ChromeDriver(options);
Any idea how i can fix this?