-
Notifications
You must be signed in to change notification settings - Fork 217
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] ERR_ABORTED while trying to download a file inside TeamCity CI machine within Chrome #863
Comments
Can you show full stack? My hunch is that It'd be also helpful if you could run failing test with |
Hi @yury-s , sorry about the screenshots, it just that the company has very strict policy about sharing. Here are also 3 screenshots from the traces, sorry for hind some data and that I am not able to provide it: Chrome version is the same as local. I will now try to run it with DEBUG=pw:protocol Just as info I found one other issue microsoft/playwright#5509 that has similar behaivior. I can also see that the file is actually downloded, but also got this net::ERR_ABORTED. The pw:protocol did not work out, so I tried pw:api |
Is it a navigation that becomes a download? If that's the case it is the same issue as #541 and this is just how Chromium behaves in that case. It's unclear though why the behavior would be different on the TeamCity machines compared to the local one. |
I think it is not navigation. After clicking on the PDF link 2 GET requests are created. From previous post within the pw:api logs we can see that page.waitForDownload is started and it returns 200 code (that can be seen from the traces screenshot), but after that timesout. Is there a way to set a bigger timeout, just to check if it has someting to do with the downlod time, althought the file is very small? |
Hi @yury-s, hope you had a nice weekend. I have one more question, is there a way to somehow to avoid using the download class. I mean I can just click on the button and the file will be downloaded, the problem is that the file name is some generated number. So I am not able to validate if the file has the .pdf extention for example. Is there a way to set up downloads to be always saved with the suggestedFilename ? This way even if I am not able to use the download class I would be able to verify if a file has been downloaded in the folder location and check its name. |
You can call download.suggestedFilename().
No, there is no way to do that. To save the file with a custom name you can call saveAs.
What do you mean by 'did not work out', no output? Looking at 'pw:api' trace there are at least 2 successful |
Hi @yury-s, seems that I have mislead you. On my local machine the chrome browser is version 99 and the download is not throwing. On the Teamcity machine the browser version is 88. I found the following issue microsoft/playwright#3726 (comment) Could this be the problem, that the download is not working on browsers that are old more than 6 months ? |
Yeah, it may well be the case. 88 is too old there have been some changes to the download implementation since then which could fix the issue. I'd suggest you update chrome on the Teamcity machine to current stable version and try with that. |
We need more information to act on this report. Please file a new one and link to this issue when you get back to it! |
Hi all,
Our application has the functionality to export a certain type of report (pdf, csv, etc)
Playwright version 1.20.1
I have the following code:
page.locator(exportButton).click();
Download download = page.waitForDownload(() -> { page.locator(exportPDF).click(); });
As settings I have set the following:
launchOptions.headless = true;
launchOptions.channel = "chrome";
launchOptions.setDownloadsPath(Path.get(System.getProperty("user.dir")
contextOptions.acceptsDownloads = true;
I do not download browsers, I am using chrome that is already installed in the machine.
All these code lines above are working fine when I execute them locally. File gets downloded and checks are passing.
The problem comes when I try to run the test via TeamCity.The following error occure:
StackTrace:
com.microsoft.playwright.TimeoutError: Timeout 30000 ms exceeded
.....
I have a trace file in which I can see on the last step in the Network tab ->
What I can see is that the button that initiate the download has been pressed and the file is actually downloaded.
I have it within the build artifacts, so I am sure that it was downloaded.
Do you know what could cause this ERR_ABORTED, maybe I need to set some additional arguments upon browser launch.
The machine is running on Linux and it has preinstalled Chrome browser
The text was updated successfully, but these errors were encountered: