tebeka / selenium

Selenium/Webdriver client for Go
MIT License
2.51k stars 410 forks source link

Fix MoveTo docs regarding origin for offsets #324

Open derat opened 4 months ago

derat commented 4 months ago

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.