zombie.js - 'Fire' keypress in zombiejs -
zombie.js - 'Fire' keypress in zombiejs -
i need help. nail wall trying phantom work. sporadically stops working , should work, doesn't. has been frustrating. got zombiejs , running in 10th of time doing need, apart simulating keypress. can't figure out syntax firing key presses. api has following:
browser.fire(name, target, calback?) fires dom event. can utilize simulate dom event, e.g. clicking link or clicking mouse. these events bubble , can cancelled.
if has example, won't have @ phantom again. @ to the lowest degree until create api lot easier.
thanks
someone posted solution in a github issue:
zombie.browser.prototype.keyup = function(targetselector, keycode) { var event = this.window.document.createevent('htmlevents'); event.initevent('keyup', true, true); event.which = keycode; var target = this.window.document.queryselector(targetselector); target && target.dispatchevent(event); };
keypress zombie.js
Comments
Post a Comment