选择了一个元素并想要 --> 将鼠标光标物理移动到它上面。
尝试使用selenium提供的Actions类。使用的方法是moveToElement()
。
Actions actions = new Actions(driver);
actions.moveToElement(element).build().perform();
使用的驱动程序版本是 ChromeDriver 75.0.3770.90。
预期:- 物理光标必须移动到元素位置。
最佳答案
升级到 Chrome 75 后我遇到了同样的问题。
Actions actions = new Actions(driver);
actions.moveToElement(element).build().perform();
element.click();
这确实解决了我的问题。
关于javascript - ubuntu 上的 Google Chrome 75.0.3770.80 上的 Selenium Actions moveToElement 不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56615952/