selenium icon indicating copy to clipboard operation
selenium copied to clipboard

[๐Ÿ› Bug]: BiDi Mode Prevents Manual Launching/Open Files from Chrome Download Bar

Open SKumar-777 opened this issue 1 month ago โ€ข 2 comments

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

SKumar-777 avatar Nov 05 '25 15:11 SKumar-777

@SKumar-777, thank you for creating this issue. We will troubleshoot it as soon as we can.

Selenium Triage Team: remember to follow the Triage Guide

selenium-ci avatar Nov 05 '25 15:11 selenium-ci

It seems enabling BiDi triggers a Chrome security restriction that prevents manual opening downloaded files from the browser UI.

We don't implement any interactions with the browser UI outside of the DOM. This is out of our scope.

cgoldberg avatar Nov 05 '25 15:11 cgoldberg