Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Show mouse cursor in phantom.js

Is there a way to show mouse cursor in phantomjs when taking screenshot (capture)?

I am trying to use below to move mouse to XY position

sendEvent(mouseEventType[, mouseX, mouseY, button='left']) 

http://phantomjs.org/api/webpage/

But I am not sure if it works because the hover effect didn't show.

like image 332
HP. Avatar asked Dec 19 '25 21:12

HP.


1 Answers

The hover effect is supposed to show, you probably have an error in the coordinates you're passing which isn't really over the element you're looking for.

Although, you won't be able to capture a screenshot with the mouse cursor, since the cursor actually belongs to the OS and not to the browser. phantomjs simulates the browser, just without rendering it.

like image 75
gillyb Avatar answered Dec 21 '25 12:12

gillyb