I managed to solve it by setting the values directly using: tester.setParameterForNextRequest("wizard:form:view:phoneMaker", 1);
and completely bypassing the ajax. sorry for the trouble. Simon On 17/08/07, wicket user <[EMAIL PROTECTED]> wrote: > > I'm not entirely sure that this isn't bad mailing list form but this > article in the old mailing list was so close to my existing problem that I > thought that I would continue it: > > Ok, so I've got the first part of updating a DropDownChoice Ajax unit test > working as described in the forum ( > http://www.nabble.com/Unit-testing---updating-a-DropDownChoice-with-Ajax-tf3946499.html) > previously but when I try to * select* the second DropDownChoice and > submit the form I'm getting the form returning that the value is missing. > It is a required field so its supposed to object if it isn't set but I'm not > sure why it's not picking up that I've set it. > > Here is a bit of the code: > > FormTester ftester = tester.newFormTester("wizard:form"); > > // select the phone maker > ftester.select("view:phone.make", 0); > tester.executeAjaxEvent(PHONEMAKE, "onchange"); > > // select the phone model > DropDownChoice phoneModels = > (DropDownChoice)tester.getLastRenderedPage().get(PHONEMODEL); > > // This passes > assertEquals(20, phoneModels.getChoices().size()); > > // Here I'm selecting the second dropdown, as usual > right? > ftester.select("view:phone.model", 0); > > // submit the wizard to the next > ftester.submit("buttons:next"); > > tester.assertNoInfoMessage(); > > *// Here is where I'm expecting nothing but get the > missing required field* > tester.assertNoErrorMessage(); > > I've tried various combinations of the above but to no avail. > Thanks Simon > > >