actions.MoveToElement() 不适用于 ie 11

actions.MoveToElement() not working on ie 11

即使我使用的移动方法是chrome、firefox 和edge,我用c# 编写的测试自动化项目中使用的相同方法在internet explorer 11 中不起作用。它没有给出任何错误,但下一个动作是失败

log.Debug("fare " + by + " üzeriine dogru haraket ediyor, webelement label ");
IWebElement element = GetElement(by);
Actions Actions = new Actions(Driver);
WaitElementToClickable(Driver, by, 5);
Actions.MoveToElement(element);
Actions.Perform();
WaitElementToClickable(Driver, by, 5);

我花了很长时间尝试让操作在所有浏览器上工作,对于 IE,我发现以下内容有所帮助。

Selenium webdriver v2.29.0 (https://github.com/SeleniumHQ/selenium/blob/master/java/CHANGELOG) 添加:

IEDriver supports "requireWindowFocus" desired capability. When
using this and native events, the IE driver will demand focus and
user interactions will use SendInput() for simulating user
interactions. Note that this will mean you MUST NOT use the
machine running IE for anything else as the tests are running.

当我设置我使用的 IEDriver 时:

InternetExplorerOptions options = new InternetExplorerOptions();
options.requireWindowFocus();
webDriver = new InternetExplorerDriver(options);

我所有的移动和点击事件都运行良好。我正在使用 IE11.125-11.309 和 Selenium(java 绑定)3.7.1.