protractor icon indicating copy to clipboard operation
protractor copied to clipboard

Enter key in firefox

Open serzh opened this issue 12 years ago • 2 comments

Firefox: 27.0.1 Protractor: 0.20.1

Enter key doesn't work in Firefox: input.sendKeys(protractor.Keys.ENTER) doesn't trigger Enter key.

But input.sendKeys("\n") triggers.

serzh avatar Mar 15 '14 10:03 serzh

Use input.sendKeys(protractor.Keys.RETURN).

This is a discrepancy between browsers:

Keyboards

One last thing. Inputting text happens through sendKeys. Dont try to simulate form submission by hitting the enter key with protractor.Key.ENTER. That one works in Google Chrome, but will fail you in Firefox. There's also protractor.Key.RETURN. It does exactly the same and it works in both browsers.

Source: http://savanne.be/articles/testing-with-angular-js/

rubenv avatar Mar 19 '14 10:03 rubenv

Thank you. I'm closing the issue.

serzh avatar Mar 19 '14 10:03 serzh