Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

webdriver-bidi should let users know when a download is completed #427

Open
asolntsev opened this issue May 17, 2023 · 4 comments
Open

webdriver-bidi should let users know when a download is completed #427

asolntsev opened this issue May 17, 2023 · 4 comments

Comments

@asolntsev
Copy link

Use case:

I need to write an automated test that downloads a file.
My test looks like this:

  1. Click a button
  2. Wait until a download is started
  3. Wait until a download is completed
  4. Verify name and content of the downloaded file

Information from BiDi

So, the information we need from BiDi:

  1. Name and content of the downloaded file
  2. Signal (event) when the download is fully completed.

Nuances

Please take into account the following nuances:

  1. After the click, multiple files may be downloaded (we need to get info for all them!)
  2. Some downloads may last for quite a long time (say, few minutes)
  3. Some downloaded files may be quite large (say, 4 gb)
  4. Some downloads may start with a delay (say, few seconds after the click)
  5. The file may change its name during the download (the typical flow in Chrome: it first creates a file called .crdownload and later renames it to its final name when the download is completed).
@karanjeetbirdeye
Copy link

karanjeetbirdeye commented May 22, 2023

I was looking for something similar regarding file downloads, until this is implemented, I was thinking of capturing a particular request (the api which is pending for file download) from the network tab and waiting until it is not in pending state. However, I'm not able to find any documenation/examples that shows how to capture response or status code of a particular api call. Any help is appreciated. I'm using selenium 4.9.0 with java.

@asolntsev
Copy link
Author

@karanjeetbirdeye I also wanted to do this, but didn't find this request in network tab. It seems that browser uses some different mechanism for downloading files.

@ksingha161
Copy link

@asolntsev I dont think they have a particular api that tell us file downloaded is completed. In my case we have our internal api's in pending state until file download is complete. status changes to 200 when it is done. Maybe they can provide us a way to access one particular network call (whatever api we want)? then we can check if our file is downloaded or not

@asolntsev
Copy link
Author

@ksingha161 That's what we are talking about. We want Bidi to give us access to file downloads. Yes, they currently have such an API, and we want to get such an API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants