With below code I am getting only Shift + a or Alt + a, whichever is sent first followed by space. I think it is because the modifier keys is still depressed when shift is pressed, how should we terminate the keys?
browser.url('https://elements.polymer-project.org/bower_components/iron-a11y-keys/demo/index.html')
.click('x-key-aware')
.keys('Shift')
.keys('a')
.keys('Alt')
.keys('a')
.keys('\uE00D')
Thanks to @Elusive138 who answered on gitter.
https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidelementidvalue
Modifier keys (Ctrl, Shift, Alt, and Command/Meta) are assumed to be "sticky"; each modifier should be held down (e.g. only a keydown event) until either the modifier is encountered again in the sequence, or the NULL (U+E000) key is encountered.
browser.url('https://elements.polymer-project.org/bower_components/iron-a11y-keys/demo/index.html')
.click('x-key-aware')
.keys('Shift')
.keys('a')
.keys('\uE000') //Sending null character. To complete the shortcut for shift+a
.keys('Alt')
.keys('a')
.keys('\uE000') //Sending null character. To complete the shortcut for Alt+a
.keys('\uE00D')
Most helpful comment