I'm currently trying to upload an image using Puppeteer, however when I try to open the FileChooser:
Y'all know this guy https://i.stack.imgur.com/aRApS.png This is an example image
to browse and select a file, I get the following error in my console
TypeError: undefined is not a function
and then a timeout error which is expected
TimeoutError: waiting for waiting for file chooser failed: timeout 30000ms exceeded
The question would be... Why undefined? Where I went wrong? Here's my code:
const [fileChooser] = Promise.all([
page.waitForFileChooser(),
page.click("input#EventImage"),
]);
await fileChooser.accept([
__dirname + "/screenshot.png",
]);
Everything else before this is working just fine
Puppeteer version: 3.1.0