Selenium Webdriver move mouse to Point

后端 未结 8 1061
小鲜肉
小鲜肉 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:52

    Using MoveToElement you will be able to find or click in whatever point you want, you have just to define the first parameter, it can be the session(winappdriver) or driver(in other ways) which is created when you instance WindowsDriver. Otherwise you can set as first parameter a grid (my case), a list, a panel or whatever you want.

    Note: The top-left of your first parameter element will be the position X = 0 and Y = 0

       Actions actions = new Actions(this.session);
        int xPosition = this.session.FindElementsByAccessibilityId("GraphicView")[0].Size.Width - 530;
        int yPosition = this.session.FindElementsByAccessibilityId("GraphicView")[0].Size.Height- 150;
        actions.MoveToElement(this.xecuteClientSession.FindElementsByAccessibilityId("GraphicView")[0], xPosition, yPosition).ContextClick().Build().Perform();
    

提交回复
热议问题