You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by bilguun <ar...@gmail.com> on 2016/01/28 21:44:54 UTC

How to test drop down by changing value multiple times?

Hi, I am testing Drop down by selecting different values couple of times.
Here is my code:

FormTester formTester = tester.newFormTester("panel:form");
// 0 - 2014; 1 - 2015; 2 - 2016
formTester.select("year", 1);
tester.assertLabel("panel:form:subAccounts:0:accounts:0:budgeted",
"$2,115");
//
		
formTester.select("year", 2);
tester.assertLabel("panel:form:subAccounts:0:accounts:0:budgeted",
"$2,115");

In this case, second one should be failed because of that it supposed to
show $2,116 instead of $2,115 but it's not. I guess second select("year", 2)
is not working. Do you have any idea how to do this kind of test?

Thank you

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-test-drop-down-by-changing-value-multiple-times-tp4673467.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: How to test drop down by changing value multiple times?

Posted by bilguun <ar...@gmail.com>.
Thank you Martin, 

Yeah, that was absolutely one that I needed. It works great now!

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-test-drop-down-by-changing-value-multiple-times-tp4673468p4673473.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: How to test drop down by changing value multiple times?

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

You need to submit after the selection: formTester.submit().

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Thu, Jan 28, 2016 at 9:44 PM, bilguun <ar...@gmail.com>
wrote:

> Hi, I am testing Drop down by selecting different values couple of times.
> Here is my code:
>
> FormTester formTester = tester.newFormTester("panel:form");
> // 0 - 2014; 1 - 2015; 2 - 2016
> formTester.select("year", 1);
> tester.assertLabel("panel:form:subAccounts:0:accounts:0:budgeted",
> "$2,115");
> //
>
> formTester.select("year", 2);
> tester.assertLabel("panel:form:subAccounts:0:accounts:0:budgeted",
> "$2,115");
>
> In this case, second one should be failed because of that it supposed to
> show $2,116 instead of $2,115 but it's not. I guess second select("year",
> 2)
> is not working. Do you have any idea how to do this kind of test?
>
> Thank you
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/How-to-test-drop-down-by-changing-value-multiple-times-tp4673467.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: How to test drop down by changing value multiple times?

Posted by Sven Meier <sv...@meiers.net>.
Hi,

do you have an ajaxBehavior on the year selector?

Because FormTester#select() won't trigger it, you'll have to submit the 
form.

Regards
Sven


On 28.01.2016 21:44, bilguun wrote:
> Hi, I am testing Drop down by selecting different values couple of times.
> Here is my code:
>
> FormTester formTester = tester.newFormTester("panel:form");
> // 0 - 2014; 1 - 2015; 2 - 2016
> formTester.select("year", 1);
> tester.assertLabel("panel:form:subAccounts:0:accounts:0:budgeted",
> "$2,115");
> //
> 		
> formTester.select("year", 2);
> tester.assertLabel("panel:form:subAccounts:0:accounts:0:budgeted",
> "$2,115");
>
> In this case, second one should be failed because of that it supposed to
> show $2,116 instead of $2,115 but it's not. I guess second select("year", 2)
> is not working. Do you have any idea how to do this kind of test?
>
> Thank you
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-test-drop-down-by-changing-value-multiple-times-tp4673467.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org