selenium icon indicating copy to clipboard operation
selenium copied to clipboard

Fix MoveTo docs regarding origin for offsets

Open derat opened this issue 1 year ago • 0 comments

WebElement.MoveTo's documentation stated that the supplied offsets are interpreted relative to the element's center, but this seems to be incorrect. Since remoteWE's implementation always passes "xoffset" and "yoffset" parameters, the offsets are interpreted relative to the element's top-left corner.


The spec states that the mouse is moved to the center of the element if no offsets are supplied, but that offsets are interpreted relative to the top-left corner of the element.

Here's the implementation, which unconditionally passes offsets:

https://github.com/tebeka/selenium/blob/e9100b7f5ac11727841302026707e3961ba14712/remote.go#L1415-L1421

See also #190.

derat avatar Apr 21 '24 11:04 derat