WinAppDriver icon indicating copy to clipboard operation
WinAppDriver copied to clipboard

How to reset the mouse position to the left most corner before doing action using movebyoffset?

Open HenryColes opened this issue 5 years ago • 2 comments

I am trying to click on a glyph icon by using its screen co-ordinates. For that, I am using MoveByOffset() method. Since mine is an automation element, i cant use MoveToElement() since it expects an IWebElement to be passed.

I know that MoveByOffset moves the mouse to the specified offset of the last known mouse coordinates. So I need to first reset the mouse position by moving to the left most corner.

Any help is appreciated.

HenryColes avatar Feb 28 '20 13:02 HenryColes

You can use the following properties of the element in question to move mouse :

winElement.Location.X
winElement.Location.Y

The width and height of the element can be found using following properties:

winElement.Size.Height
winElement.Size.Width

naeemakram avatar Mar 02 '20 12:03 naeemakram

Have you managed to do it?

EyalExperitest avatar Mar 08 '22 15:03 EyalExperitest