-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
[BUG] Playwright-core - Timeout while waiting for event \"download\"\nNote: #3726
Comments
Since num is a ElementHandle, the click method does not accept a new selector. You have to use Example: // @ts-check
const playwright = require("playwright");
(async () => {
const browser = await playwright.chromium.launch()
const context = await browser.newContext({
acceptDownloads: true
})
const page = await context.newPage()
await page.goto(
"https://file-examples.com/index.php/sample-documents-download/sample-xls-download/"
);
const handles = await page.$$("#table-files .file-link");
for (let num of handles) {
const [download] = await Promise.all([
page.waitForEvent("download"), // wait for download to start
(await num.$("a.btn")).click(),
]);
const path = await download.path();
console.log(path)
}
await browser.close();
})(); Interactive: https://try.playwright.tech/?s=gd4r9 |
Hi Max, Thanks you very much for your help. I tried your solution. It does not work on aws lambda with playwright-core 1.3.0, but with PLW 1.0.2 works fine. Error: @mxschmitt is it possible to test playwright-core local? |
Could you please run with |
@dgozman |
I think this should be possible directly in Node, if you use javascript lambda: // Set the env variable.
process.env.DEBUG = 'pw:api,pw:browser*';
// Use playwright.
const browser = await require('playwright').chromium.launch({}); |
@osmenia Just out of curiosity, is this working fine locally and just not working with AWB lambda? |
Yes, Code works locally fine. all good I did not test with playwright-code 1.4 |
@osmenia Hey just wanted to let you know that I tested with playwright 1.4 and it is working for me if you want to try that out |
@jknooks583 How did you do test? For me does not work :( Here ist code:
I create Layer with Playwright 1.0.2
This is result:
Files are downloaded with playwright 1.0.2. Download works all good. I createt Layer with Playwright 1.3.0
I am getting Error:
This is layer with plawright 1.4.0
**I replaced " Then I got this Error:
Please find attached Log Files. @dgozman @mxschmitt |
Sorry for the slow response 😞 I have looked at the logs, and unfortunately I don't see where the problem comes from. Two ideas:
|
Closing because we cannot reproduce and there is no additional information to make progress. |
Hi Gozman, |
Hi Team, first of all I would like to wish you a happy new year! I am runing code on aws lambda.
Config:
run with param: process.env.DEBUG = 'pw:api,pw:browser,pw:protocol'** Error:
Please find attached log file. I tried also with another page with download, did not work on aws. Local works fine.
Can you pls help |
@osmenia I do not know much about aws lambda environment, but it seems that playwright-aws-lambda does some unzipping of Chromium binary to |
@dgozman The download was completed but I did not receive the completion callback. I used two approaches:
Received timeout error
Did not receive any timeout error and the lambda function kept running, and ultimately, timed out. I came up with the second approach to check if the on download event is emitted, which isn't. So something's up with the events on lambda. I have a project due, very soon, so any urgent help would be really appreciated. This is the package I am using for chrome on lambda: https://github.com/JupiterOne/playwright-aws-lambda |
@imhashir Thank you for digging into this issue. Looking at |
@imhashir @dgozman you can try this: |
@dgozman @osmenia Now the only issue with downgrade approach is that the |
maybe this can help:
|
Hello Guys, I having the timeout error as below: my version is as follows: there is any way to solve this issue? |
Context:
Hi Team,
I am testing playwright-core with AWS lambda.
there is problem with page.waitForEvent("download") in playwright-code 1.3.0.
page.waitForEvent("download") works fine with playwright-code 1.0.2 but with playwright-code 1.3.0 does not.
Error:
"TimeoutError: page.waitForEvent: Timeout 30000ms exceeded.",
"Note: use DEBUG=pw:api environment variable and rerun to capture Playwright logs.",
" at ProgressController.run (/opt/node_modules/playwright-core/lib/progress.js:71:30)",
" at Page.waitForEvent (/opt/node_modules/playwright-core/lib/page.js:243:35)",
" at Page.waitForEvent (/opt/node_modules/playwright-core/lib/helper.js:80:31)",
Code Snippet
The text was updated successfully, but these errors were encountered: