A_K
(A K)
November 3, 2023, 9:58am
1
Problem with automatic downloads in chrome incognito. since the latest version of chrome it is not possible to automatically download files 119. Does anyone know how to solve this problem so that the files are automatically downloaded?
Anyone figured out how to solve this problem?
I found a link about a bug in incognito mode on chrome webdriver, even if we try to download something in the browser manually in incognito mode the download prompt will appear.
This is the bug link:
opened 05:30AM - 07 Nov 23 UTC
closed 11:23AM - 07 Nov 23 UTC
I-defect
needs-triaging
G-chromedriver
### What happened?
Code used to launch the chrome incognito:
var choptions … = new ChromeOptions();
choptions.PageLoadStrategy = PageLoadStrategy.Normal;
if (RunInHeadlessMode())
{
choptions.AddArguments("--headless");
choptions.AddArguments("--disable-gpu");
choptions.AddArguments("--window-size=1920,1080");
}
choptions.AddArgument("--start-maximized");
choptions.AddArguments("incognito");
choptions.AddArguments("--no-sandbox");
choptions.AddUserProfilePreference("download.default_directory", Selenium.UserActions.FileInteractions.DownloadFolderPath);
choptions.AddUserProfilePreference("download.prompt_for_download", false);
choptions.AddUserProfilePreference("profile.default_content_settings.popups", 0);
choptions.AddUserProfilePreference("download.prompt_for_download", false);
choptions.AddUserProfilePreference("download.directory_upgrade", true);
var experiments = new List<string>();
experiments.Add("download-bubble@2");
experiments.Add("download-bubble-v2@2");
choptions.AddLocalStatePreference("browser", new { enabled_labs_experiments = experiments});
ChromeOptions = choptions;
Capable = choptions;
### How can we reproduce the issue?
```shell
Code snippet given above
And this happens only in incognito mode
```
### Relevant log output
```shell
In both incognito and normal mode, if the download option is already set in Chrome options then it should work consistently.
```
### Operating System
Windows 10
### Selenium version
3.141.0
### What are the browser(s) and version(s) where you see this issue?
Chrome incognito 119
### What are the browser driver(s) and version(s) where you see this issue?
Chrome incognito 119
### Are you using Selenium Grid?
Yes we are using both for CI pipeline and local