Skip to content

[πŸš€ Feature]: Remote WebDriver - Check if the file download has finished.Β #14915

@limuyuan

Description

@limuyuan

Feature and motivation

On this page: https://www.selenium.dev/documentation/webdriver/drivers/remote_webdriver/#list-downloadable-files

It said:
List Downloadable Files
Be aware that Selenium is not waiting for files to finish downloading, so the list is an immediate snapshot of what file names are currently in the directory for the given session.

Is it possible that Selenium can natively support the function of "wait for files to finish downloading"?

I found a similar issue #10884 but it was closed.

Usage example

I'm using the sample code here: https://github.com/SeleniumHQ/seleniumhq.github.io/blob/trunk/examples/dotnet/SeleniumDocs/Drivers/RemoteWebDriverTest.cs#L69

WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(5));
wait.Until(d => ((RemoteWebDriver)d).GetDownloadableFiles().Contains(downloadFileName));

However, the target file was generated immediately as a 0KB file, and there is another .part file, which is making the wait.Until useless.
image

Is it possible to provide a feature so we can know the file was completely downloaded?

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-needs-triagingA Selenium member will evaluate this soon!I-enhancementSomething could be better

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions