Hi, See the javadoc of org.apache.wicket.util.tester.BaseWicketTester#clickLink(java.lang.String, boolean)
Martin Grigorov Wicket Training and Consulting On Thu, Mar 13, 2014 at 8:06 PM, Nick Pratt <nbpr...@gmail.com> wrote: > How do you submit a form via WicketTester and an AjaxSubmitLink? > > > *HomePage.java:* > > public class HomePage extends WebPage > { > private static final long serialVersionUID = 1L; > > private String email; > > public HomePage( final PageParameters parameters ) > { > super( parameters ); > > Form form = new Form( "form" ); > add( form ); > > form.add( new EmailTextField( "email", new PropertyModel(this, "email") ) > ); > form.add( new AjaxSubmitLink("submit") > { > @Override > protected void onSubmit( AjaxRequestTarget target, Form<?> form ) > { > int i = 0; > } > }); > } > } > > *HomePage.html* > > <!DOCTYPE html> > <html xmlns:wicket="http://wicket.apache.org"> > <body> > > <form wicket:id="form"> > <input type="email" wicket:id="email" placeholder="Email"> > <button type="submit" wicket:id="submit">Sign Up</button> > </form> > > </body> > </html> > > *Unit Test:* > > @Test > public void testPanel() throws Exception > { > WicketTester tester = new WicketTester(); > tester.startPage( HomePage.class ); > > FormTester formTester = tester.newFormTester( "form" ); > formTester.setValue( "email", "t...@test.com" ); > formTester.submit( "submit" ); > } >