-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[🚀 Feature]: List all downloaded files in a session (Grid) #11458
Comments
It would be ideal to list only files that have been downloaded in the current session. How can that be achieved without adding brittle magic to the code that can become unmaintainable? Let's keep in mind that:
|
Yeah, it's all in the Processing Model part of the spec:
Just need to nest everything under "value" key. Example return from
|
I don't think this feature is even worth doing if we can't split out by session. |
As I mentioned in #11466, I think for file downloads we should be using |
I'm saying I think we need to change the implementation to do things that way. |
Fixes: SeleniumHQ#11466, SeleniumHQ#11458 New format `POST /se/files` Request: `{ "filename": "file" }` Response: ``` { "value": { "filename": "filename", "contents": "ContentsGoHere" } } ``` `GET /se/files` Request: NONE Response: ``` { "value": { "files":[ "1", "2", "3" ] } } ```
Let's agree if this is what we want to implement here:
return this:
|
@titusfortner - I dont have any specific opinion regarding the timestamp. Incase we do agree to add timestamps (since @diemol proposed it, am assuming he agrees, and I am fine with it as well, are we looking at a buy-in from anyone else apart from you ?) I would just like the timestamp to be an Please let me know and i will update my PR to include the timestamp changes |
Fixes: SeleniumHQ#11466, SeleniumHQ#11458 New format `POST /se/files` Request: `{ "filename": "file" }` Response: ``` { "value": { "filename": "filename", "contents": "ContentsGoHere" } } ``` `GET /se/files` Request: NONE Response: ``` { "value": { "files":[ "1", "2", "3" ] } } ```
The more I think about it, the less I think it is useful to add timestamps. So I think we should avoid them, unless @diemol feels they are important. |
@titusfortner While @diemol gets back with his inputs.. trying to pick your brain.. What is your rationale behind not having timestamps. I mean what do you see as hindrances/pitfalls by including them. |
I don't think they provide much additional value, and it's a lot easier to parse a list than a list of hashes to get the item you want to download or to iterate, etc. |
That was just an example payload, timestamps are not a must on the return payload. |
Fixes: SeleniumHQ#11466, SeleniumHQ#11458 New format `POST /se/files` Request: `{ "filename": "file" }` Response: ``` { "value": { "filename": "filename", "contents": "ContentsGoHere" } } ``` `GET /se/files` Request: NONE Response: ``` { "value": { "files":[ "1", "2", "3" ] } } ```
Fixes: SeleniumHQ#11466, SeleniumHQ#11458 New format `POST /se/files` Request: `{ "filename": "file" }` Response: ``` { "value": { "filename": "filename", "contents": "ContentsGoHere" } } ``` `GET /se/files` Request: NONE Response: ``` { "value": { "files":[ "1", "2", "3" ] } } ```
* Filedownloads url - Adhere to w3c standards Fixes: #11466, #11458 New format `POST /se/files` Request: `{ "name": "file" }` Response: ``` { "value": { "filename": "filename", "contents": "ContentsGoHere" } } ``` `GET /se/files` Request: NONE Response: ``` { "value": { "names":[ "1", "2", "3" ] } } ```
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Feature and motivation
#11443 is a proposal to implement file download on the client bindings. However, to download a file you need to know the file name, and this might be tricky given that most of the time the application under test does not let you choose the name that will be used when the file is downloaded.
We should have an endpoint that lists the downloaded files in the configured download directory in Grid. Then the user can choose the name of the one they want to download.
Usage example
Something along the lines of:
/session/:sessionId:/se/file
Which could return:
But I am not 100% that is the W3C WebDriver response payload structure, we should adapt to that one. @titusfortner do you know?
The main challenge in this issue is to decide if we need to list files that belong to a session or if it is OK to list all downloaded files.
The text was updated successfully, but these errors were encountered: