我只是想知道在 Leadfoot 中执行 Ctrl + 单击操作的首选方法是什么。在 java 中,我会使用 Actions 类并使用 keyDown,但由于我们已经转向基于 JS 的框架,我彻底脱离了水!
我在api中看到有一个pressKeys函数,但它似乎没有做我们需要的事情。我曾考虑过使用 jQuery 来做到这一点,但我真的宁愿将其保留在当前框架中。
非常感谢任何帮助。
彼得
最佳答案
您可以使用pressKeys
,例如:
command.moveMouseTo(myBtn)
.pressKeys(keys.CONTROL)
.clickMouseButton()
.pressKeys(keys.CONTROL)
关于pressKeys
值得记住的一件好事( https://theintern.github.io/leadfoot/Command.html#pressKeys )
keys: The text to type in the remote environment. It is possible to type keys that do not have normal character representations (modifier keys, function keys, etc.) as well as keys that have two different representations on a typical US-ASCII keyboard (numpad keys); use the values from leadfoot/keys to type these special characters. Any modifier keys that are activated by this call will persist until they are deactivated. To deactivate a modifier key, type the same modifier key a second time, or send \uE000 ('NULL') to deactivate all currently active modifier keys.
关于javascript - 在 Intern.js Leadfoot 中,如何执行 CTRL 单击,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35361468/