Maybe you hit the problem in https://issues.apache.org/jira/browse/WICKET-3711
On Thu, May 26, 2011 at 3:30 PM, Mathilde Pellerin <mathilde.pelle...@gmail.com> wrote: > Hi all, > > I am testing a form with FormTester and WicketTester. > When I test error messages which are send by form validation, test works > well : > tester.assertErrorMessages(new String[] {"Le champ 'Identifiant' est > obligatoire."}); > > but when I test error message which is send by my submit ajaxButton, test > fail : no error is sent. > When I test application manually, this error appears in feedBackPanel. > I don't understand why error is not sent when application is used by > wicketTester. > > This is my submit button code : > AjaxButton submitbutton = new AjaxButton("ajaxSubmitLogin") { > > @Override > protected void onSubmit(AjaxRequestTarget target, Form<?> form) > { > Membre modelObject = (Membre) form.getModelObject(); > Membre membre; > > membre = serviceIdentif.identifier(modelObject.getId(), > modelObject.getPassword()); > if(membre == null) > error("Identifiant ou mot de passe incorrect"); > else > setResponsePage(TableauBordPage.class); > } > > @Override > protected void onError(AjaxRequestTarget target, Form<?> form) { > target.addComponent(feedBackPanel); > } > } > > and my test code > FormTester formTester = > tester.newFormTester(loginForm.getPageRelativePath()); > formTester.setValue("membreId", "benj"); > formTester.setValue("password", "password"); > formTester.submit("ajaxSubmitLogin"); > > tester.assertErrorMessages(new String[] {"Identifiant ou mot de > passe incorrect"}); > > -- > Mathilde Pellerin Ingénieur en Génie Logiciel Tél mobile : > 06.60.78.79.03 E-mail > : mathilde.pelle...@gmail.com Mon CV en ligne : > <http://www.mathilde-pellerin.fr/> http://www.mathilde-pellerin.fr/ Mes > liens : <http://www.viadeo.com/fr/profile/mathilde.pellerin> > <http://fr.linkedin.com/in/mathildepellerin> > -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org