Selenium sendKeys are not sending all characters Selenium sendKeys are not sending all characters selenium selenium

Selenium sendKeys are not sending all characters


I assume this is caused by this Angular2 issue https://github.com/angular/angular/issues/5808

Angular can't process input events when they arrive too fast.

As a workaround you would need to send single characters with a small delay between each.


I stumbled upon this error when doing integration tests with NightwatchJS (which uses selenium).

So I'm writing this for people coming here in the future.

I wrote this extension command for nightwatch:

exports.command = function (selector, value, using) {    var self = this;    self.elements(using || 'css selector', selector, function (elems) {        elems.value.forEach(function (element) {            for (var c of value.split('')) {                self.elementIdValue(element.ELEMENT, c);            }        });    });    return this;};

Which can be used in this way:

var username = 'integration@test.com';browser.setValueSlow('input[ngcontrol=username]', username); //Works with ng2!

This issue was also discussed on NightwatchJS's github here


I was getting this error too in Java, Selenium. You might also be getting this error too while writing your codes - "sendKeys (CharSequence) from the type Webelement refers to the missing type charSequence"

I tried varying the wait time and even typing extra characters before the main characters, they did not work.

The simple trick I used was to change the Java Compiler version from JRE 9 to JRE 10.