Apr 27 2020 04:54 AM - edited Apr 27 2020 06:16 AM
I'm using Edge v81.0.416.64 to run Selenium Tests using the matching Edge WebDriver, however it does not seem to be possible to set a custom download directory using the "download.default_directory" user profile preference, used in Chrome. I know that there is the option to change the download directory using group policies (https://docs.microsoft.com/en-us/DeployEdge/microsoft-edge-policies#downloaddirectory), but this is no viable option for web tests.
Am I missing something/is there another way? Is this something planned for the future?
EDIT: Setting the "download.default_directory" user profile preference works in Edge v79.0.309.65.
Apr 28 2020 09:05 AM
@Marcel_Holle we made some changes to MSEdgeDriver in v 81 that seem to be impacting your tests. Can you share the code sample for how you create the driver() object?
-John
Apr 29 2020 01:06 AM
Hi @johnjansen ,
var edgeOptions = new EdgeOptions
{
BinaryLocation = BrowserBinaryPath
};
DisableSpecCompliance (edgeOptions); // force "w3c" capability to false
AdjustBrowserNameCapability (edgeOptions); // Set DriverOptions.BrowserName to "MicrosoftEdge" instead of "Chrome"
edgeOptions.AddArgument ($"user-data-dir={userDirectory}");
edgeOptions.AddArgument ("no-first-run");
edgeOptions.AddArgument ("force-device-scale-factor=1");
edgeOptions.AddUserProfilePreference ("safebrowsing.enabled", true);
edgeOptions.AddUserProfilePreference ("download.default_directory", DownloadDirectory);
var driverService = ChromeDriverService.CreateDefaultService (driverDirectory, driverExecutable);
driverService.EnableVerboseLogging = false;
driverService.LogPath = logPath;
var driver = new ChromeDriver (driverService, _extendedEdgeOptions, commandTimeout);
driver.Manage().Timeouts().AsynchronousJavaScript = asyncJavaScriptTimeout;
Apr 29 2020 11:17 AM
Solution@Marcel_Holle thanks for the code, that helps so much. The issue is because you are using ChromeDriver() which is not supported on Edge 81 and newer. We wrote a pretty cool tool to enable this to work more seamlessly here: https://github.com/microsoft/edge-selenium-tools
Basically, it is fully backward compatible with the old Edge browser as well as the new Edge browser to try to help people save time writing new tests.
-John
May 04 2020 03:42 AM
thank you so much, using Microsoft.Edge.SeleniumTools solved our issue.
Apr 29 2020 11:17 AM
Solution@Marcel_Holle thanks for the code, that helps so much. The issue is because you are using ChromeDriver() which is not supported on Edge 81 and newer. We wrote a pretty cool tool to enable this to work more seamlessly here: https://github.com/microsoft/edge-selenium-tools
Basically, it is fully backward compatible with the old Edge browser as well as the new Edge browser to try to help people save time writing new tests.
-John