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
[Question] about downloads with launchPersistentContext #5947
Comments
https://playwright.dev/docs/downloads is a good start! It comers some of your questions already. |
I changed up a lot of the code to match what was in your link but with no luck, and i also made a better description to describe my problems. The files, however are still deleted after the script finishes, even with acceptDownloads set to true and a downloadsPath set. Im unsure whether its because of a problem with launchPersistentContext downloads or if it's the way the download page handles downloading files, cause if i have I have no idea how to solve this. |
@Mbensler the fact that you can't get download path is definitely a bug. A few things:
|
Hi @aslushnikov
Basically, from what i can gather the error happens when pressing the save button. The save button opens a target=_blank page that contains the download, but while it is downloading the script just keeps running in the background, and if It seems like it doesn't recognize downloads that open in other windows? |
@Mbensler Regarding the freezing of your test when using I guess it might also work on your side (= avoiding the test to freeze when using download.functions) if you either use Firefox in headful mode instead of Chromium or you use the headless mode for Chromium. (As a temporary workaround if the described issue gets resolved at some point.) |
Should be fixed by #6082, can you validate the fix with playwright@next? |
Fixed, validated with playwright@next. |
Hello I am writing a script in which i log in to a page, and download some files.
Here is how the download works:
I press the button with the text "Gem" which opens a target_blank page which downloads the file, and that page then closes.
Clicking the "Gem" button opens up the url from the following forms
action
The download happens but the script freezes after the first downloaded file. Removing
const dl = await download.path();
makes it so the script finishes entirely and downloads both files, BUT THE FILES ARE DELETED WHEN THE BROWSER CONTEXT IS CLOSED.How do i solve this? Help would be much appreciated!!!
The text was updated successfully, but these errors were encountered: