the form exists in the page and i am sure.
const form = await page.$('#my-form');
await form.evaluate(form => form.submit());
I get this error:
TypeError: form.evaluate is not a function
EDIT 2019: As mentioned by Kyle, the latest puppeteer have .evaluate method on elementHandle. It's been two years after all.
const tweetHandle = await page.$('.tweet .retweets');
expect(await tweetHandle.evaluate(node => node.innerText)).toBe('10');
You can try it this way,
await page.evaluate(() => {
const element = document.querySelector("#my-form")
element.submit()
});
ElementHandle
does not have a .evaluate
function property. Check the docs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With