I\'m using Java, Selenium, and Chrome for test automation. Our developers recently upgraded our UI from AngularJS to Angular2 (not sure if that matters). But since then, sendKey
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