Forum Discussion
Set download directory via WebDriver
- Apr 29, 2020
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
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
- Marcel_HolleApr 29, 2020Copper Contributor
Hi johnjansen ,
we're using Selenium 3.141.0.0 & ChromeDriver classes: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;
- johnjansenApr 29, 2020
Microsoft
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
- Marcel_HolleMay 04, 2020Copper Contributor
thank you so much, using Microsoft.Edge.SeleniumTools solved our issue.