I'm using the latest version of JWebUnit-HtmlUnit plugin (2.2) along with Maven 2.2 to run some test cases. My question is, how do I simulate a user clicking the "Enter" key when inside a text field? I'm trying to write a test case for clicking enter to see if it acts like clicking the Submit button on my page.
No, I don't think JWebUnit can do that; it'd be browser-specific anyway.
Hitting enter in a text field causes a form submit - not a click on the submit button. So the only difference would be if the click on the submit button does something beside simply submitting the form.
Thanks, - Dave
Joined: Mar 22, 2005
Joined: Jul 02, 2008
I need the JS because there are two type=submit buttons on the page, and the first one is a "Cancel" button, so clicking "Enter" executes the Cancel action, which I do not want.