I am trying to automate some things only with phantomjs. Doing the same work with casperjs works but the challenge is to get it working only with phantomjs. I want to press enter in a normal textfield which I have focused on.
page.sendEvent('keypress', page.event.key.A); //this works
page.sendEvent('keypress', page.event.key.Enter); //this doesn't work
The script runs without any errors but in the output I can see that the enter event did not work.
I tested another function which worked:
page.sendEvent('keypress', page.event.key.A); //this works
page.sendEvent('keypress', page.event.key.Backspace); //this works
Why is only the enter event not working? Every other key works. Is there a way to do it with keycodes?