Selenium Webdriver move mouse to Point

后端 未结 8 1072
小鲜肉
小鲜肉 2020-12-05 11:24

I am currently trying to move the cursor to a point (org.openqa.selenium.Point) that has been set by checking for an occurrence of a marker on a live chart from

8条回答
  •  借酒劲吻你
    2020-12-05 11:43

    If you are using a RemoteWebDriver, you can cast WebElement into RemoteWebElement. You can then call getCoordinates() on that object to get the coordinates.

            WebElement el = driver.findElementById("elementId");
            Coordinates c = ((RemoteWebElement)el).getCoordinates();
            driver.getMouse().mouseMove(c);
    

提交回复
热议问题