Has anybody used htmlunit (or jwebunit) with success
to create a functional test for a wicket application
that contains ajax code?
In a few words: I have a html page with a select
element inside. When I select an option from this, an
ajax request is made on the server and an input text
appears on the page. 
My question is: How can I retrieve the input text in
the unit test using htmlunit/jwebunit?
I have here a very simple unit test that doesn't work
(I cann't retrieve the input text).

WebClient webClient = new WebClient();
webClient.setRedirectEnabled(true);
webClient.setJavaScriptEnabled(true);           
HtmlPage page = (HtmlPage) webClient.getPage(baseUrl);
Htmlform form = (HtmlForm) page.getForms().get(0);
HtmlSelect select = form.getSelectByName("mySelect");
page = (HtmlPage) select.setSelectedAttribute("0",
true);
assertTrue(page.getEnclosingWindow().getThreadManager().joinAll(5
* 1000));
System.out.println(page.asXml());

I attached the entire source code of the test.
I used wicket 1.2.2 and htmlunit 1.9 with java 1.5 on
linux.
Where could be the problem (wicket, htmlunit, my
code)?

Thanks,
Decebal

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Attachment: src.tar.gz
Description: 1009463993-src.tar.gz

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to