
Hi @Code Toaster,You could try the following possible solutions:
1.Make sure you are using the latest version of Microsoft Edge (127.0.2651.86) and Edge driver.
2.Kill all the processes of Microsoft Edge in Task Manager before you run the code and test again.
3.You can try to keep only Edge options and remove Chrome options. As show below:
var options = new EdgeOptions();
options.AddArgument("--start-maximized");
options.AddArgument("no-sandbox");
options.AddArgument("--headless");
If the above method still does not work, you can try the following method.
1.Back up your User Data
folder in the same path. Here for example, I back up the User Data
folder as User Data1
:
2.Use User Data1
in your code to specify using Default profile when run Edge with Selenium:
var options = new EdgeOptions();
var service = EdgeDriverService.CreateDefaultService("C:\\Users\\XYZ\\ABC\\", "msedgedriver.exe");
options.AddArgument("user-data-dir=C:\\Users\\XYZ\\AppData\\Local\\Microsoft\\Edge\\User Data1");
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Best Regards,
Jinxin Wang