I have my console app in c# and try to open Chrome browser with my profile. But when i run the application there isn't any profile authenticated.
I try to set:
chromeOptions.EnableMobileEmulation("Nexus 5");
chromeOptions.AddArgument("–no-sandbox");
chromeOptions.AddArguments("-disable-gpu");
chromeOptions.AddArguments("-disable-dev-shm-usage");
chromeOptions.AddArguments("-user-data-dir=C:\\Users\\user\\AppData\\Local\\Google\\Chrome\\User Data\\");
But not work, open chrome without my account. I must add some argument?
Thanks
CodePudding user response:
You have to mention like this:
# path of the chrome's profile parent directory
chromeOptions.AddArguments(r"user-data-dir=C:\\Users\\User\\AppData\\Local\\Google\\Chrome\\User Data")
# name of the directory
chromeOptions.AddArguments("--profile-directory=Default")