Selenium VBA-如何将鼠标移动到位置(x,y)?

Selenium VBA-如何将鼠标移动到位置(x,y)?,vba,selenium,selenium-chromedriver,Vba,Selenium,Selenium Chromedriver,我想将鼠标移动到某个位置(0,0)。在上一次单击操作之后,我实际上需要将鼠标从该位置移开,因为它会干扰我需要执行的下一个操作 我发现以下Java代码是一个完美的起点,但我无法将其转换为VBA并适应我的需要 Actions action = new Actions(webdriver); WebElement we = webdriver.findElement(By.xpath("html/body/div[13]/ul/li[4]/a")); action.moveToEl

我想将鼠标移动到某个位置(0,0)。在上一次单击操作之后,我实际上需要将鼠标从该位置移开,因为它会干扰我需要执行的下一个操作

我发现以下Java代码是一个完美的起点,但我无法将其转换为VBA并适应我的需要

Actions action = new Actions(webdriver);
WebElement we = webdriver.findElement(By.xpath("html/body/div[13]/ul/li[4]/a"));
action.moveToElement(we).moveToElement(webdriver.findElement(By.xpath("/expression-here"))).click().build().perform();
资料来源:

我是这样解决的:

Set el = driver.FindElementByXPath("//head")
driver.Actions.MoveToElement(el).Perform
根据@QHarr的评论,我没有移动到坐标,而是移动到一个元素:“head”。
这样,我的下一个selenium步骤不会受到鼠标位置的干扰,鼠标位置之前触发了一个“mousehover”事件。

您想移动到元素还是坐标?@QHarr,我可以找到一个移动到元素的(Java)示例,但我需要的是移动到坐标,坐标会根据屏幕分辨率的不同而变化,除非你想在网页上滚动。您确定移动到其他元素然后继续执行程序是不够的吗?