selenium-chromedriver

chromedriver version 122+ started randmoly popping up save as dialog for selenium tests c#


All of a sudden my automated test have started failing intermittently. Every few tests chrome will popup a save as dialog when downloading a file. I have these preferences set.

    var chromeOptions = new ChromeOptions();
                        if(_seleniumBrowserDriverOptions.EnableCrossDomainRequests)
                            chromeOptions.AddArgument("--disable-web-security");
                        chromeOptions.AddUserProfilePreference("download.default_directory", _seleniumBrowserDriverOptions.DownloadPath);
                        chromeOptions.AddUserProfilePreference("download.prompt_for_download", false);
                        chromeOptions.AddUserProfilePreference("download.directory_upgrade", true);
                        chromeOptions.AddUserProfilePreference("profile.default_content_settings.popups", "0");
                        chromeOptions.AddUserProfilePreference("disable-popup-blocking", "true");
                        var chromeDriver = new ChromeDriver(chromeOptions);

This seems to only happen when I run multiple test together. If I run them each separately I don't have an issue

Tried other suggested answers


Solution

  • This ended up just being that I was overriding the downloads path to a relative path. once I switched to a full path that does not have a trailing \