0

I'm trying to do some browser automation and the page that I am trying to do this on will not work if i just do a value = . Seems like, when I type and click out, it will actually autocorrect the value inside the field and validate it.

If this code below dispatch a real event, how to I get the event to show up the letter "a" inside my input field?

window.dispatchEvent(new KeyboardEvent('keydown', {
  'key': 'a'
}));
  • You might want to try dispatching that event on an `` element instead of the `window` – Phil Feb 22 '22 at 04:43

0 Answers0