How to make protractor press the enter key?

后端 未结 6 1031
执笔经年
执笔经年 2020-12-15 15:09

I\'ve tried this:

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

which gives the error:

<         


        
6条回答
  •  北海茫月
    2020-12-15 15:46

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

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

提交回复
热议问题