Hi,

Put a breakpoint in the button's onSubmit() method and see whether it
is actually called.
It could be that you need to call formTester.submit("myForm:myButton");

On Mon, Aug 13, 2012 at 5:18 PM, JCoder <i...@jcoder.de> wrote:
> Hi all,
>
> Im working at a basic Unit Test that looks like this:
>
> 1. tester.assertRenderedPage(FirstPage.class);
> 2. FormTester formTester = tester.newFormTester("myForm");
> 3. formTester.submit("myButton");
> 4. tester.assertRenderedPage(SecondPage.class);
>
> All lines work as expected. Only line 4 fails. I just want to verify a click 
> on a button and after that a certain Page (SecondPage) should be rendered.
>
> The test fails with: "junit.framework.AssertionFailedError: 
> expected:<SecondPage> but was:<FirstPage>"
> What did I wrong?
>
> Cheers & Thanks in advance,
> Y
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>



-- 
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

Reply via email to