selenoid icon indicating copy to clipboard operation
selenoid copied to clipboard

How to (re)set initial mouse position for OS?

Open qtis opened this issue 3 years ago • 4 comments

We are experiencing problem that OS cursor seems to be placed in the middle of the screen and affects mouse events when application is running.

I took a screenshot from recording (before chrome starts, which is in next second) and you can see mouse cursor in the middle of the screen.

image

Is there a way to control or remove OS mouse cursor as chromedriver (via webdriver) seems to emulate it's own cursor, not via OS so you end up with two cursors :|

qtis avatar Dec 21 '21 12:12 qtis

@qtis you can add xdotool command call to browser image entrypoint.sh to fix this. Currently this is not supported out of the box.

vania-pooh avatar Dec 21 '21 13:12 vania-pooh

@qtis you can add xdotool command call to browser image entrypoint.sh to fix this. Currently this is not supported out of the box.

That helped. Now I've built custom image based on chrome_vnc with xdotool installed via Docker build and extra line in entrypoint.sh before chromedriver start:

echo Moving mouse to position 0 0
DISPLAY="$DISPLAY" /usr/bin/xdotool mousemove 0 0

You can see it is in the corner now:

image

Request Would be great if you could also add it to official images as same issue might be causing issues for other as well. Otherwise I guess I'd have to rebuild custom images on each release ¯_(ツ)_/¯

qtis avatar Dec 22 '21 14:12 qtis

We experience a cursor displayed when we run Chrome with mobile emulation enabled (experimental option mobileEmulation). No cursor would be expected, none is shown when using other hubs with the same settings. Is it related to this same issue?

gdonati78 avatar Feb 16 '22 10:02 gdonati78

@gdonati78 Chrome in mobile emulation is the same as Chrome desktop. So yes, that's related.

vania-pooh avatar Feb 17 '22 12:02 vania-pooh