如何让量角器按回车键?

2022-01-16 00:00:00 angularjs protractor javascript

我试过了:

browser.actions().keyDown(protractor.Key.ENTER).keyUp(protractor.Key.Enter).perform();

给出错误:

Error: Not a modifier key

推荐答案

Keyup/Keydown 仅限于 WebDriver 中的修饰键(shift、ctrl 等).我想你想要

Keyup/Keydown is limited to modifier keys in WebDriver (shift, ctrl, etc). I think you want

browser.actions().sendKeys(protractor.Key.ENTER).perform();

相关文章