You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by Bruno Borges <br...@gmail.com> on 2007/05/10 19:35:42 UTC

FormTester.setValue not working

>
> FormTester form = tester.newFormTester("form");
> form.setValue("id", "555");
> form.setValue("name", "foo");
>
> form.submit();
>
> tester.assertNoErrorMessage();
>
>
This code is not working as error messages comes up anyway. Is this the
right way to test a Form? If nobody has ever tried this, I'll create an
issue to it on JIRA.

[]'s!
miojo
-- 
Bruno Borges
Summa Technologies Inc.
www.summa-tech.com
(48) 8404-1300
(11) 3055-2060

Re: FormTester.setValue not working

Posted by behlma <be...@googlemail.com>.
Hi Bruno,
FormTester actually does work. I've been playing around with it the last
couple of days. Have you got any validators set on your form fields? Like
LengthValidator? Furthermore what error messages do you get?


Bruno Borges wrote:
> 
>>
>> FormTester form = tester.newFormTester("form");
>> form.setValue("id", "555");
>> form.setValue("name", "foo");
>>
>> form.submit();
>>
>> tester.assertNoErrorMessage();
>>
>>
> This code is not working as error messages comes up anyway. Is this the
> right way to test a Form? If nobody has ever tried this, I'll create an
> issue to it on JIRA.
> 
> []'s!
> miojo
> -- 
> Bruno Borges
> Summa Technologies Inc.
> www.summa-tech.com
> (48) 8404-1300
> (11) 3055-2060
> 
> 

-- 
View this message in context: http://www.nabble.com/FormTester.setValue-not-working-tf3723076.html#a10420455
Sent from the Wicket - Dev mailing list archive at Nabble.com.


Re: FormTester.setValue not working

Posted by Jean-Baptiste Quenot <jb...@apache.org>.
You may want to have a look at the unit tests for FormTester:

org.apache.wicket.util.tester.apps_4.FormTesterTest
org.apache.wicket.util.tester.WicketTesterTest

And if you can extend them to cover your usecase, that would be
great too!
-- 
     Jean-Baptiste Quenot
aka  John Banana   Qwerty
http://caraldi.com/jbq/