I've been trying to figure out how to click a button on a page using x and y coordinates in puppeteer but I haven't been able to get it working. This is what i'm currently using.
await page.mouse.click(x, y, {button: 'left'})
No errors occur, it simply isn't clicking on any element. So my guess is i'm not finding it's position correctly.
I'm using the default viewport in puppeteer which is 800px by 600px. This is what i'm doing to manually try and locate the x and y of the button in the DOM.
document.getElementsByClassName("classname")[0].getBoundingClientRect().x
> 90.125
document.getElementsByClassName("classname")[0].getBoundingClientRect().y
> 128
So I add it to the click event.
await page.mouse.click(90.125 , 128, {button: 'left'})
And nothing happens. What am I doing wrong?