Selenium Webdriver move mouse to Point

后端 未结 8 1069
小鲜肉
小鲜肉 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 12:02

    Why use java.awt.Robot when org.openqa.selenium.interactions.Actions.class would probably work fine? Just sayin.

    Actions builder = new Actions(driver);
    
    builder.keyDown(Keys.CONTROL)
       .click(someElement)
       .moveByOffset( 10, 25 );
       .click(someOtherElement)
       .keyUp(Keys.CONTROL).build().perform();
    

提交回复
热议问题