-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
Description
Description
I noticed an issue when using Chrome in BiDi mode (options.UseWebSocketUrl = true) via Selenium. When a file is downloaded, it appears in the Chrome downloads menu (top-right corner), but manually clicking it in the browser does not launch or open the file(.txt). If BiDi mode is disabled, the same file can be launched from the downloads menu without issues.
It seems enabling BiDi triggers a Chrome security restriction that prevents manual opening downloaded files from the browser UI.
ChromeOptions options = new ChromeOptions();
options.UseWebSocketUrl = true; // Enable BiDi protocol
options.AddArgument("--remote-debugging-pipe");
options.AddArgument("--enable-unsafe-extension-debugging");
options.AddArgument("--no-sandbox");
IWebDriver driver = new RemoteWebDriver(new Uri("http://xxxxxxx"), options);
driver.Navigate().GoToUrl("https://www.mysamplefiles.com/download-free-docx-files-samples");
// Click download button
// File downloads and appears in Chrome "Downloads" menu
// Clicking manually does not open/launch the file (Works if I launch it from File Explorer)
This behavior is unexpected compared to standard Chrome sessions and could affect users relying on BiDi automation while needing to interact with downloads.
Could you please clarify if this is a known limitation or if there’s a workaround/fix?
Reproducible Code
ChromeOptions options = new ChromeOptions();
options.UseWebSocketUrl = true; // Enable BiDi protocol
options.AddArgument("--remote-debugging-pipe");
options.AddArgument("--enable-unsafe-extension-debugging");
options.AddArgument("--no-sandbox");
IWebDriver driver = new RemoteWebDriver(new Uri("http://xxxxxxx"), options);
driver.Navigate().GoToUrl("https://www.mysamplefiles.com/download-free-docx-files-samples");
// Click download button
// File downloads and appears in Chrome "Downloads" menu
// Clicking manually does not open/launch the file