How to simulate pressing enter in html text input with Selenium?
In a web interface, I've got a text field. When user enters text and accepts with enter, application performs an action.
I wanted to test the behavior with Selenium. Unfortunately, invoking 'keypress' with chr(13) insert representation of the character into the field.
Is there a way other then submitting the form? I'd like to mimic intended user interaction, without any shortcuts...
This Java code works for me:
Notice the escape. You probably need something like chr(\13)