Selenium Webdriver move mouse to Point

后端 未结 8 1064
小鲜肉
小鲜肉 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条回答
  •  -上瘾入骨i
    2020-12-05 11:53

    I am using JavaScript but some of the principles are common I am sure.

    The code I am using is as follows:

        var s = new webdriver.ActionSequence(d);
        d.findElement(By.className('fc-time')).then(function(result){
            s.mouseMove(result,l).click().perform();
        });
    

    the driver = d. The location = l is simply {x:300,y:500) - it is just an offset.

    What I found during my testing was that I could not make it work without using the method to find an existing element first, using that at a basis from where to locate my click.

    I suspect the figures in the locate are a bit more difficult to predict than I thought.

    It is an old post but this response may help other newcomers like me.

提交回复
热议问题