Selenium java webdriver 3: moveToElement不工作。
WebElement element = ...
Actions actions = new Actions(driver);
actions.moveToElement(element).build().perform();
已尝试,添加单击()
WebElement element = ...
Actions actions = new Actions(driver);
actions.moveToElement(element).click().build().perform();
不起作用。鼠标未移动。
发布于 2019-05-28 22:41:03
WebElement abcd = ..........
Actions actions = new Actions(driver);
actions.moveToElement(abcd).perform();
上面的代码可以工作,但请检查您的机器上使用的chrome.exe版本和chrome版本。两者都应该相互兼容。检查与以下链接的兼容性。
发布于 2019-05-02 16:37:28
跳过build()
部分,不管怎样,perform()
都是在底层做的。
发布于 2020-01-06 14:50:09
Actions actions = new Actions(driver);
WebElement element = driver.findElement(By.linkText("host"));
actions.moveToElement(element).build().perform();
这将会起作用。首先检查你的"find element“方法是写的还是错误的。请将此步骤也张贴出来。否则你的代码是正确的。
https://stackoverflow.com/questions/55946205
复制相似问题