且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何点击canvas中的特定元素的坐标(使用WebDriver)?

更新时间:2023-01-15 18:23:29

移动



move_to(element)指定的元素的中心, move_by 是一个相对移动。所以通过这两个操作的结束,你已经移动到坐标(元素中心+ x的x,元素中心+ y的y)

Movement

move_to(element) moves to the center of the element specified and move_by is a relative move. So by the end of these two operations, you have moved to the coordinates (x of element center + x, y of element center + y).

您应该使用 move_to(element,x,y)。这将移动到相对于元素原点的 x,y 坐标。

You should use move_to(element, x, y). This will move to the x, y coordinates relative to the origin of the element.

相关文档

您使用的是Selenium和Firefox的版本,而Selenium支持本地事件? Selenium 2.37与Firefox 24的组合。我有测试套件失败,因为本机事件不可用。

Are you using a version of Selenium and Firefox for which Selenium supports native events? The combination of Selenium 2.37 with Firefox 24 does. I've had test suite fails just because native events were not available.