(Created on )

Puppeteer: Click must occur a positive number of times.

Mouse click count is zero or negative.


Mouse click count is zero or negative.

Error message

Click must occur a positive number of times.

How this error happens

count tells the mouse how many clicks to perform. Zero or a negative count is not a valid click operation.

The snippets use an open Puppeteer page named page.

await page.mouse.click(
    100,
    100,
    {
        count: 0,
    }
);

How to fix

Use a positive count. Skip the API call entirely if your application decides that no click is needed.

await page.mouse.click(
    100,
    100,
    {
        count: 1,
    }
);

All Puppeteer errors

Keep Reading

Puppeteer Guides

All Guides →