You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
await page.type('textarea', `Hello World\n\nThis is a bot.`, { delay: 10 });
await page.waitForTimeout(5000);
await page.keyboard.press('Enter');
It doesn't wait typing complete text. It cut off after "Hello World".
Also I get error message page.waitForTimeout is not a function.
I tried a simple delay function await new Promise((resolve) => setTimeout(resolve, 5000)); But this also doesn't work either (no error but it doesn't wait 5 seconds).
await page.keyboard.press('Enter'); This enters twice.
Thank you @RubberArchind. My mistake was having await page.click('textarea');
However, I wanna keep this ticket open for another issue. If you add next lines with \n\n, it automatically enters. await page.type('textarea', Hello World.\n\nThis is a bot., { delay: 10 }); This enters after Hello World.
Overall if you avoid \n\n in the input, you can run fine. The following works now.
await page.goto('https://www.perplexity.ai', { waitUntil: 'networkidle0' });
await page.waitForSelector('textarea', { visible: true, timeout: 5000 });
await page.focus('textarea');
await page.type('textarea', `Hello World. This is a bot.`, { delay: 10 });
await new Promise((resolve) => setTimeout(resolve, 2000));
await page.keyboard.press('Enter');
just enter it then since you use backthick it should be worked i guess.
await page.type('textarea', `Hello World.
This is a bot.`, { delay: 10 });
Description
page.waitForTimeout is not a function
.await new Promise((resolve) => setTimeout(resolve, 5000));
But this also doesn't work either (no error but it doesn't wait 5 seconds).await page.keyboard.press('Enter');
This enters twice.Full steps to reproduce the issue
Please run the following code to view the bug.
---package.json---
---node version---
node -v
v20.14.0
Issue Type
Bug
Operating System
Mac OS
Do you use Docker?
None
The text was updated successfully, but these errors were encountered: