2011-06-23 185 views
3

我使用Selenium方法mouseMoveAt(java.lang.String locator,java.lang.String coordString),它需要coordStringSelenium:如何使用x和y坐标位置

例如:coordString - x,y position (10,20)。如果我使用10代替x20代表y坐标,这是什么意思?

回答

0

查看WebElement类的org.openqa.selenium.Point类和getLocation()方法。

Point getLocation() 页面上的哪个位置是渲染元素的左上角? 返回: 的点,包含该元素的顶部左上角的位置

1

mouseMoveAt(E,(x,y))

这意味着模拟鼠标移动到一个特定的(X,Y)相对位置的顶元素E的左角,与元素在屏幕上的位置无关。