Open galaczi opened 3 hours ago
probably your target is undefined as the error states
It shouldn't be undefined. Playwright's page.fill
finds it. cursor.getElemBoundingBox
also finds it.
I can click with:
const button = await cursor.getRandomPointInsideElem(await cursor.getElemBoundingBox('#button'))
await page.mouse.click(button.x, button.y)
does await cursor.actions.move and await cursor.actions.click throw undefined?
cursor.actions.move does not throw, only cursor.actions.click. Same selector.
ok try find path of the element you target -> inspector aim it then press Copy JS path, paste that path in curosr.actions.click target and let me know if that works
You mean without document.querySelector, right? That wouldn't be a valid value for target. Yes, I have copied the selector from the browser as you suggested all along. It is found by playwright's locators, so it's definitely there. Maybe some kind of visibility or actionability test is the issue? locator.click() works though, so I don't think that should be an issue.
Check out the example in repo and see if you doesn't miss anything. I messed around with the code now but everything works as intended. The thing that throws you error is: write in the spawned page console
window['mouseTarget']
this cant be undefined
Hi, I am trying to click a button:
And getting this error:
Any idea why that happens?